main.yml 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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. command: >
  21. {{ openshift_client_binary }} delete -n openshift-infra istag node:v3.10 --ignore-not-found
  22. --config={{ openshift.common.config_base }}/master/admin.kubeconfig
  23. - name: Apply the config
  24. run_once: true
  25. command: >
  26. {{ openshift_client_binary }} apply -f "{{ mktemp.stdout }}"
  27. --config={{ openshift.common.config_base }}/master/admin.kubeconfig
  28. - name: Remove temp directory
  29. run_once: true
  30. file:
  31. state: absent
  32. name: "{{ mktemp.stdout }}"
  33. changed_when: False