main.yml 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. ---
  2. # Fact setting
  3. # - name: Set default image variables based on deployment type
  4. # include_vars: "{{ item }}"
  5. # with_first_found:
  6. # - "{{ openshift_deployment_type | default(deployment_type) }}.yml"
  7. # - "default_images.yml"
  8. - name: Ensure openshift-sdn project exists
  9. oc_project:
  10. name: openshift-sdn
  11. state: present
  12. node_selector:
  13. - ""
  14. - name: Make temp directory for templates
  15. command: mktemp -d /tmp/console-ansible-XXXXXX
  16. register: mktemp
  17. changed_when: False
  18. - name: Copy web console templates to temp directory
  19. copy:
  20. src: "{{ item }}"
  21. dest: "{{ mktemp.stdout }}/{{ item | basename }}"
  22. with_fileglob:
  23. - "files/*.yaml"
  24. - name: Update the image tag
  25. yedit:
  26. src: "{{ mktemp.stdout }}/sdn-images.yaml"
  27. key: 'tag.from.name'
  28. # TODO: this should be easier to replace
  29. value: "{{ osn_image }}:{{ openshift_image_tag }}"
  30. when: oreg_url is defined
  31. - name: Ensure the SDN can run privileged
  32. oc_adm_policy_user:
  33. namespace: "openshift-sdn"
  34. resource_kind: scc
  35. resource_name: privileged
  36. state: present
  37. user: "system:serviceaccount:openshift-sdn:sdn"
  38. - name: Apply the SDN config
  39. shell: >
  40. {{ openshift_client_binary }} apply -f {{ mktemp.stdout }}
  41. - name: Remove temp directory
  42. file:
  43. state: absent
  44. name: "{{ mktemp.stdout }}"
  45. changed_when: False