Browse Source

fixed volume-config bug; this wasn't being applied appropriately

Matt Woodson 6 years ago
parent
commit
77029a66b2

+ 2 - 1
playbooks/openshift-master/private/openshift_node_config.yml

@@ -4,4 +4,5 @@
   gather_facts: no
   tasks:
   - name: include openshift node config
-    import_tasks: tasks/node_config.yml
+    import_role:
+      name: openshift_node_group

+ 3 - 1
playbooks/openshift-master/private/tasks/enable_bootstrap_config.yml

@@ -1,5 +1,7 @@
 ---
-- import_tasks: node_config.yml
+- name: Setup the node group config maps
+  import_role:
+    name: openshift_node_group
 
 - name: Setup the node bootstrap auto approver
   import_role:

+ 0 - 4
playbooks/openshift-master/private/tasks/node_config.yml

@@ -1,4 +0,0 @@
----
-- name: Setup the node group config maps
-  import_role:
-    name: openshift_node_group

+ 2 - 1
roles/openshift_node_group/defaults/main.yml

@@ -21,7 +21,8 @@ openshift_node_group_labels: []
 
 openshift_node_labels_edit:
 - key: kubeletArguments.node-labels
-  value: "{{ openshift_node_group_labels }}"
+  value:
+  - "{{ openshift_node_group_labels | join(',') }}"
 
 openshift_use_crio: False
 l_crio_var_sock: "/var/run/crio/crio.sock"

+ 31 - 4
roles/openshift_node_group/tasks/create_config.yml

@@ -8,7 +8,8 @@
   run_once: true
 
 - name: debug node config
-  debug: var=configout
+  debug:
+    var: configout
   run_once: true
 
 - when:
@@ -44,12 +45,20 @@
     when: openshift_node_group_edits|length > 0
     run_once: true
 
+  - name: show the yeditout debug var
+    debug:
+      var: yeditout
+    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 != ""
+    - "'data' not in configout['results']['results'][0] or 'volume-config.yaml' not in configout['results']['results'][0]['data']"
+    - openshift_node_group_name != ""
+    - openshift_node_local_quota_per_fsgroup is defined
+    - openshift_node_local_quota_per_fsgroup != ""
     run_once: true
 
   - name: lay down the volume config from the existing configmap
@@ -57,10 +66,28 @@
       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 != ""
+    - "'data' in configout['results']['results'][0]"
+    - "'volume-config.yaml' in configout['results']['results'][0]['data']"
+    - openshift_node_group_name != ""
+    - openshift_node_local_quota_per_fsgroup is defined
+    - openshift_node_local_quota_per_fsgroup != ""
+    run_once: true
+
+  - name: "specialize the volume config for {{ openshift_node_group_name }}"
+    yedit:
+      content:
+      src: "{{ mktempout.stdout }}/volume-config.yaml"
+      key: localQuota.perFSGroup
+      value: "{{ openshift_node_local_quota_per_fsgroup }}"
+    register: volume_yeditout
+    when:
+    - openshift_node_local_quota_per_fsgroup is defined
+    - openshift_node_local_quota_per_fsgroup != ""
     run_once: true
 
-  - debug: var=yeditout
+  - name: show the volume_yeditout debug var
+    debug:
+      var: volume_yeditout
     run_once: true
 
   - name: create node-config.yaml configmap