summaryrefslogtreecommitdiffstats
path: root/roles/openshift_logging/tasks/install_logging.yaml
diff options
context:
space:
mode:
authorewolinetz <ewolinet@redhat.com>2017-01-13 15:04:57 -0600
committerewolinetz <ewolinet@redhat.com>2017-01-13 15:16:23 -0600
commit8db66f0929fecb26b3c4e71fe0797f20df13007a (patch)
tree0cc550ed38ebb7acde999c671a273e365258f44b /roles/openshift_logging/tasks/install_logging.yaml
parent55ddb4f4b901632f051251ba0387a107dd3bb7ef (diff)
downloadopenshift-8db66f0929fecb26b3c4e71fe0797f20df13007a.tar.gz
openshift-8db66f0929fecb26b3c4e71fe0797f20df13007a.tar.bz2
openshift-8db66f0929fecb26b3c4e71fe0797f20df13007a.tar.xz
openshift-8db66f0929fecb26b3c4e71fe0797f20df13007a.zip
Using oc_apply task for idempotent
Diffstat (limited to 'roles/openshift_logging/tasks/install_logging.yaml')
-rw-r--r--roles/openshift_logging/tasks/install_logging.yaml19
1 files changed, 9 insertions, 10 deletions
diff --git a/roles/openshift_logging/tasks/install_logging.yaml b/roles/openshift_logging/tasks/install_logging.yaml
index 6a11baeb9..af03e9371 100644
--- a/roles/openshift_logging/tasks/install_logging.yaml
+++ b/roles/openshift_logging/tasks/install_logging.yaml
@@ -23,16 +23,15 @@
loop_control:
loop_var: install_component
-- name: Register API objects from generated templates
- command: ls -1 {{mktemp.stdout}}/templates/
- register: logging_objects
- check_mode: no
- changed_when: no
-
-- name: Creating API objects from generated templates
- command: >
- {{ openshift.common.client_binary }} --config={{ mktemp.stdout }}/admin.kubeconfig apply -f {{mktemp.stdout}}/templates/{{file}} -n {{openshift_logging_namespace}}
- with_items: "{{logging_objects.stdout_lines | sort}}"
+- 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"
loop_control:
loop_var: file
when: not ansible_check_mode