generate_rolebindings.yaml 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. ---
  2. - name: generate view role binding for the hawkular service account
  3. template:
  4. src: rolebinding.j2
  5. dest: "{{ mktemp.stdout }}/templates/hawkular-rolebinding.yaml"
  6. vars:
  7. obj_name: hawkular-view
  8. labels:
  9. metrics-infra: hawkular
  10. roleRef:
  11. name: view
  12. subjects:
  13. - kind: ServiceAccount
  14. name: hawkular
  15. changed_when: no
  16. - name: generate hawkular-metrics cluster role binding for the hawkular service account
  17. template:
  18. src: rolebinding.j2
  19. dest: "{{ mktemp.stdout }}/templates/hawkular-cluster-rolebinding.yaml"
  20. vars:
  21. cluster: True
  22. obj_name: hawkular-namespace-watcher
  23. labels:
  24. metrics-infra: hawkular
  25. roleRef:
  26. kind: ClusterRole
  27. name: hawkular-metrics
  28. subjects:
  29. - kind: ServiceAccount
  30. name: hawkular
  31. namespace: "{{openshift_metrics_project}}"
  32. changed_when: no
  33. - name: generate the hawkular cluster role
  34. template:
  35. src: hawkular_metrics_role.j2
  36. dest: "{{ mktemp.stdout }}/templates/hawkular-cluster-role.yaml"
  37. changed_when: no
  38. - name: Set hawkular cluster roles
  39. oc_obj:
  40. name: hawkular-metrics
  41. namespace: "{{ openshift_metrics_project }}"
  42. kind: clusterrole
  43. files:
  44. - "{{ mktemp.stdout }}/templates/hawkular-cluster-role.yaml"
  45. delete_after: true