main.yaml 859 B

1234567891011121314151617181920212223242526272829303132333435
  1. ---
  2. - name: Set default image variables based on openshift_deployment_type
  3. include_vars: "{{ item }}"
  4. with_first_found:
  5. - "{{ openshift_deployment_type }}.yml"
  6. - "default_images.yml"
  7. - name: Create temp directory for doing work in on target
  8. command: mktemp -td openshift-prometheus-ansible-XXXXXX
  9. register: mktemp
  10. changed_when: False
  11. - set_fact:
  12. tempdir: "{{ mktemp.stdout }}"
  13. - name: Create templates subdirectory
  14. file:
  15. state: directory
  16. path: "{{ tempdir }}/{{ item }}"
  17. mode: 0755
  18. changed_when: False
  19. with_items:
  20. - templates
  21. - include_tasks: install_prometheus.yaml
  22. when: openshift_prometheus_state == 'present'
  23. - include_tasks: uninstall_prometheus.yaml
  24. when: openshift_prometheus_state == 'absent'
  25. - name: Delete temp directory
  26. file:
  27. name: "{{ tempdir }}"
  28. state: absent
  29. changed_when: False