install.yaml 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. ---
  2. - name: Ensure openshift-monitor-availability project
  3. oc_project:
  4. state: present
  5. name: openshift-monitor-availability
  6. description: Openshift availability monitoring applications.
  7. - name: Label namespace
  8. oc_label:
  9. state: present
  10. kind: namespace
  11. name: openshift-monitor-availability
  12. labels:
  13. - key: openshift.io/cluster-monitoring
  14. value: "true"
  15. - name: Create temp directory for doing work in on target
  16. command: mktemp -td openshift-monitor-availability-XXXXXX
  17. register: mktemp
  18. changed_when: False
  19. - name: Copy files to temp directory
  20. copy:
  21. src: "{{ role_path }}/files/"
  22. dest: "{{ mktemp.stdout }}"
  23. - name: Copy admin client config
  24. copy:
  25. src: "{{ openshift.common.config_base }}/master/admin.kubeconfig"
  26. dest: "{{ mktemp.stdout }}/admin.kubeconfig"
  27. remote_src: yes
  28. - name: Ensure Prometheus role exists
  29. command: >
  30. {{ openshift_client_binary }} apply --config={{ mktemp.stdout }}/admin.kubeconfig -f {{ mktemp.stdout }}/prometheus-k8s-role.yaml
  31. - name: Ensure Prometheus role binding exists
  32. command: >
  33. {{ openshift_client_binary }} apply --config={{ mktemp.stdout }}/admin.kubeconfig -f {{ mktemp.stdout }}/prometheus-k8s-role-binding.yaml
  34. - import_tasks: install_monitor_app_create.yaml
  35. - name: Delete temp directory
  36. file:
  37. name: "{{ mktemp.stdout }}"
  38. state: absent
  39. changed_when: False