diff options
Diffstat (limited to 'roles/openshift_logging')
-rw-r--r-- | roles/openshift_logging/library/openshift_logging_facts.py | 4 | ||||
-rw-r--r-- | roles/openshift_logging/tasks/generate_configmaps.yaml | 2 | ||||
-rw-r--r-- | roles/openshift_logging/tasks/install_logging.yaml | 21 |
3 files changed, 17 insertions, 10 deletions
diff --git a/roles/openshift_logging/library/openshift_logging_facts.py b/roles/openshift_logging/library/openshift_logging_facts.py index 8bbfdf7bf..64bc33435 100644 --- a/roles/openshift_logging/library/openshift_logging_facts.py +++ b/roles/openshift_logging/library/openshift_logging_facts.py @@ -105,9 +105,9 @@ class OpenshiftLoggingFacts(OCBaseCommand): def add_facts_for(self, comp, kind, name=None, facts=None): ''' Add facts for the provided kind ''' - if comp in self.facts is False: + if comp not in self.facts: self.facts[comp] = dict() - if kind in self.facts[comp] is False: + if kind not in self.facts[comp]: self.facts[comp][kind] = dict() if name: self.facts[comp][kind][name] = facts diff --git a/roles/openshift_logging/tasks/generate_configmaps.yaml b/roles/openshift_logging/tasks/generate_configmaps.yaml index b24a7c342..8fcf517ad 100644 --- a/roles/openshift_logging/tasks/generate_configmaps.yaml +++ b/roles/openshift_logging/tasks/generate_configmaps.yaml @@ -49,7 +49,7 @@ - copy: content: "{{curator_config_contents}}" dest: "{{mktemp.stdout}}/curator.yml" - when: curator_config_contenets is defined + when: curator_config_contents is defined changed_when: no - command: > diff --git a/roles/openshift_logging/tasks/install_logging.yaml b/roles/openshift_logging/tasks/install_logging.yaml index af03e9371..a9699adb8 100644 --- a/roles/openshift_logging/tasks/install_logging.yaml +++ b/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 |