main.yml 915 B

123456789101112131415161718192021222324252627282930313233343536
  1. ---
  2. - name: Make temp directory for templates
  3. command: mktemp -d /tmp/ansible-XXXXXX
  4. register: mktemp
  5. changed_when: False
  6. - name: Copy templates to temp directory
  7. copy:
  8. src: "{{ item }}"
  9. dest: "{{ mktemp.stdout }}/{{ item | basename }}"
  10. with_fileglob:
  11. - "files/*.yaml"
  12. - name: Update the image tag
  13. run_once: true
  14. yedit:
  15. src: "{{ mktemp.stdout }}/openshift-bootstrap-images.yaml"
  16. key: 'tag.from.name'
  17. value: "{{ osn_image }}"
  18. # TODO: temporary until we fix apply for image stream tags
  19. - name: Remove the image stream tag
  20. shell: >
  21. {{ openshift_client_binary }} delete -n openshift-infra istag node:v3.10 --ignore-not-found
  22. - name: Apply the config
  23. run_once: true
  24. shell: >
  25. {{ openshift_client_binary }} apply -f "{{ mktemp.stdout }}"
  26. - name: Remove temp directory
  27. run_once: true
  28. file:
  29. state: absent
  30. name: "{{ mktemp.stdout }}"
  31. changed_when: False