main.yml 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. ---
  2. # Ensures user workload monitoring is enabled.
  3. #
  4. # XXX: Only needed for the TODO items below.
  5. #- name: Load the main configmap if it is there already.
  6. # kubernetes.core.k8s_info:
  7. # kubeconfig: tmp/kubeconfig-ocp4
  8. # validate_certs: no
  9. # api_version: v1
  10. # kind: configmap
  11. # namespace: openshift-monitoring
  12. # name: cluster-monitoring-config
  13. # register: cmc_is_there
  14. #
  15. # TODO
  16. #- name: Extract the contents of config.yaml from cm if it existed.
  17. #
  18. # TODO
  19. #- name: Merge the existing config.yaml and our additions.
  20. #
  21. # TODO: do the same for uwm-alertmanager
  22. #
  23. # TODO: might want to add alert-routing-edit rolebinding to create-ichp-project/templates/project-template.yml
  24. #
  25. # XXX: Exclude projects by adding "openshift.io/user-monitoring=false" label.
  26. #
  27. - name: Ensure that the main configmap is defined.
  28. kubernetes.core.k8s:
  29. kubeconfig: tmp/kubeconfig-ocp4
  30. validate_certs: no
  31. api_version: v1
  32. kind: configmap
  33. namespace: openshift-monitoring
  34. name: cluster-monitoring-config
  35. resource_definition:
  36. data:
  37. config.yaml: |
  38. enableUserWorkload: true
  39. alertmanagerMain:
  40. enableUserAlertmanagerConfig: true
  41. - name: Ensure that the uwm alertmanager configmap is defined.
  42. kubernetes.core.k8s:
  43. kubeconfig: tmp/kubeconfig-ocp4
  44. validate_certs: no
  45. api_version: v1
  46. kind: configmap
  47. namespace: openshift-user-workload-monitoring
  48. name: user-workload-monitoring-config
  49. resource_definition:
  50. data:
  51. config.yaml: |
  52. alertmanager:
  53. enabled: true
  54. enableAlertmanagerConfig: true
  55. ...