From 5b5c1813eb379b53ffad3f26bbb7db67f9f0e797 Mon Sep 17 00:00:00 2001 From: Seth Jennings Date: Fri, 18 May 2018 15:42:34 -0500 Subject: [PATCH] add volume config generation --- .../tasks/create_config.yml | 29 +++++++++++++++++++ .../templates/volume-config.yaml.j2 | 4 +++ 2 files changed, 33 insertions(+) create mode 100644 roles/openshift_node_group/templates/volume-config.yaml.j2 diff --git a/roles/openshift_node_group/tasks/create_config.yml b/roles/openshift_node_group/tasks/create_config.yml index 8b3218e7b5a..8c817132951 100644 --- a/roles/openshift_node_group/tasks/create_config.yml +++ b/roles/openshift_node_group/tasks/create_config.yml @@ -44,6 +44,22 @@ when: openshift_node_group_edits|length > 0 run_once: true + - name: create volume config template + template: + src: volume-config.yaml.j2 + dest: "{{ mktempout.stdout }}/volume-config.yaml" + when: + - configout.results.results.0 == {} and openshift_node_group_name != "" and openshift_node_local_quota_per_fsgroup is defined and openshift_node_local_quota_per_fsgroup != "" + run_once: true + + - name: lay down the volume config from the existing configmap + copy: + content: "{{ configout.results.results.0.data['volume-config.yaml'] }}" + dest: "{{ mktempout.stdout }}/volume-config.yaml" + when: + - configout.results.results.0 != {} and openshift_node_group_name != "" and openshift_node_local_quota_per_fsgroup is defined and openshift_node_local_quota_per_fsgroup != "" + run_once: true + - debug: var=yeditout run_once: true @@ -53,6 +69,19 @@ namespace: "{{ openshift_node_group_namespace }}" from_file: node-config.yaml: "{{ mktempout.stdout }}/node-config.yaml" + when: + - openshift_node_local_quota_per_fsgroup is undefined or openshift_node_local_quota_per_fsgroup == "" + run_once: true + + - name: create node-config.yaml and volume-config.yaml configmap + oc_configmap: + name: "{{ openshift_node_group_name }}" + namespace: "{{ openshift_node_group_namespace }}" + from_file: + node-config.yaml: "{{ mktempout.stdout }}/node-config.yaml" + volume-config.yaml: "{{ mktempout.stdout }}/volume-config.yaml" + when: + - openshift_node_local_quota_per_fsgroup is defined and openshift_node_local_quota_per_fsgroup != "" run_once: true - name: remove templated files diff --git a/roles/openshift_node_group/templates/volume-config.yaml.j2 b/roles/openshift_node_group/templates/volume-config.yaml.j2 new file mode 100644 index 00000000000..76118d3022e --- /dev/null +++ b/roles/openshift_node_group/templates/volume-config.yaml.j2 @@ -0,0 +1,4 @@ +apiVersion: kubelet.config.openshift.io/v1 +kind: VolumeConfig +localQuota: + perFSGroup: {{ openshift_node_local_quota_per_fsgroup }}