Bläddra i källkod

Merge pull request #3136 from jcantrill/logging_oc_apply

fix openshift_logging oc_apply to allow running on any control node
Jason DeTiberus 8 år sedan
förälder
incheckning
5f92d54e6e
1 ändrade filer med 14 tillägg och 7 borttagningar
  1. 14 7
      roles/openshift_logging/tasks/install_logging.yaml

+ 14 - 7
roles/openshift_logging/tasks/install_logging.yaml

@@ -23,23 +23,30 @@
   loop_control:
     loop_var: install_component
 
+- find: paths={{ mktemp.stdout }}/templates patterns=*.yaml
+  register: object_def_files
+  changed_when: no
+
+- slurp: src={{item}}
+  register: object_defs
+  with_items: "{{object_def_files.files | map(attribute='path') | list | sort}}"
+  changed_when: no
+
 - name: Create objects
   include: oc_apply.yaml
   vars:
     - kubeconfig: "{{ mktemp.stdout }}/admin.kubeconfig"
     - namespace: "{{ openshift_logging_namespace }}"
-    - file_name: "{{ file }}"
-    - file_content: "{{ lookup('file', file) | from_yaml }}"
-  with_fileglob:
-    - "{{ mktemp.stdout }}/templates/*.yaml"
+    - file_name: "{{ file.source }}"
+    - file_content: "{{ file.content | b64decode | from_yaml }}"
+  with_items: "{{ object_defs.results }}"
   loop_control:
     loop_var: file
   when: not ansible_check_mode
 
 - name: Printing out objects to create
-  debug: msg="{{lookup('file', file)|quote}}"
-  with_fileglob:
-    - "{{mktemp.stdout}}/templates/*.yaml"
+  debug: msg={{file.content | b64decode }}
+  with_items: "{{ object_defs.results }}"
   loop_control:
     loop_var: file
   when: ansible_check_mode