main.yaml 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. ---
  2. - fail:
  3. msg: "The openshift_manageiq role requires OpenShift Enterprise 3.1 or Origin 1.1."
  4. when: not openshift.common.version_gte_3_1_or_1_1 | bool
  5. - name: Add Management Infrastructure project
  6. oc_project:
  7. name: management-infra
  8. description: Management Infrastructure
  9. - name: Create Admin and Image Inspector Service Account
  10. oc_serviceaccount:
  11. name: "{{ item }}"
  12. namespace: management-infra
  13. state: present
  14. with_items:
  15. - management-admin
  16. - inspector-admin
  17. - name: Create manageiq cluster role
  18. oc_clusterrole:
  19. name: management-infra-admin
  20. rules:
  21. - apiGroups:
  22. - ""
  23. resources:
  24. - pods/proxy
  25. verbs:
  26. - "*"
  27. - name: Create Hawkular Metrics Admin Cluster Role
  28. oc_clusterrole:
  29. name: hawkular-metrics-admin
  30. rules:
  31. - apiGroups:
  32. - ""
  33. resources:
  34. - hawkular-alerts
  35. - hawkular-metrics
  36. verbs:
  37. - "*"
  38. - name: Configure role/user permissions
  39. oc_adm_policy_user:
  40. namespace: management-infra
  41. resource_name: "{{ item.resource_name }}"
  42. resource_kind: "{{ item.resource_kind }}"
  43. user: "{{ item.user }}"
  44. with_items: "{{ manage_iq_tasks }}"
  45. - name: Configure 3_2 role/user permissions
  46. oc_adm_policy_user:
  47. namespace: management-infra
  48. resource_name: "{{ item.resource_name }}"
  49. resource_kind: "{{ item.resource_kind }}"
  50. user: "{{ item.user }}"
  51. with_items: "{{manage_iq_openshift_3_2_tasks}}"
  52. when: openshift.common.version_gte_3_2_or_1_2 | bool