main.yaml 828 B

123456789101112131415161718192021222324252627282930313233
  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 }}/templates"
  17. mode: 0755
  18. changed_when: False
  19. - include_tasks: install_prometheus.yaml
  20. when: openshift_prometheus_state == 'present'
  21. - include_tasks: uninstall_prometheus.yaml
  22. when: openshift_prometheus_state == 'absent'
  23. - name: Delete temp directory
  24. file:
  25. name: "{{ tempdir }}"
  26. state: absent
  27. changed_when: False