main.yml 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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. # TODO: Wait for components to start up?
  28. #
  29. - name: Ensure that the main configmap is defined.
  30. kubernetes.core.k8s:
  31. kubeconfig: tmp/kubeconfig-ocp4
  32. validate_certs: no
  33. api_version: v1
  34. kind: configmap
  35. namespace: openshift-monitoring
  36. name: cluster-monitoring-config
  37. resource_definition:
  38. data:
  39. config.yaml: |
  40. enableUserWorkload: true
  41. alertmanagerMain:
  42. enableUserAlertmanagerConfig: true
  43. - name: Ensure that the uwm alertmanager configmap is defined.
  44. kubernetes.core.k8s:
  45. kubeconfig: tmp/kubeconfig-ocp4
  46. validate_certs: no
  47. api_version: v1
  48. kind: configmap
  49. namespace: openshift-user-workload-monitoring
  50. name: user-workload-monitoring-config
  51. resource_definition:
  52. data:
  53. config.yaml: |
  54. alertmanager:
  55. enabled: true
  56. enableAlertmanagerConfig: true
  57. ...