---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
  creationTimestamp: null
  name: resource-operator-controller-manager-job
  namespace: "{{ ansible_operator_meta.namespace }}"
rules:
- apiGroups:
  - ""
  - rbac.authorization.k8s.io
  resources:
  - pods
  - serviceaccounts
  - roles
  - rolebindings
  - services
  - services/finalizers
  - endpoints
  - persistentvolumeclaims
  - events
  - configmaps
  - secrets
  - jobs
  verbs:
  - create
  - delete
  - get
  - list
  - patch
  - update
  - watch
- apiGroups:
  - apps
  resources:
  - deployments
  - daemonsets
  - replicasets
  - statefulsets
  - jobs
  verbs:
  - create
  - delete
  - get
  - list
  - patch
  - update
  - watch
- apiGroups:
  - monitoring.coreos.com
  resources:
  - servicemonitors
  verbs:
  - get
  - create
- apiGroups:
  - ""
  resources:
  - pods
  - jobs
  verbs:
  - get
- apiGroups:
  - apps
  resources:
  - replicasets
  - deployments
  - jobs
  verbs:
  - get
- apiGroups:
  - tower.ansible.com
  resources:
  - '*'
  verbs:
  - create
  - delete
  - get
  - list
  - patch
  - update
  - watch
- apiGroups:
  - batch
  resources:
  - '*'
  verbs:
  - create
  - delete
  - get
  - list
  - patch
  - update
  - watch

---
apiVersion: v1
kind: ServiceAccount
metadata:
  name: resource-operator-controller-manager-job
  namespace: "{{ ansible_operator_meta.namespace }}"
---
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: resource-operator-controller-manager-job
  namespace: "{{ ansible_operator_meta.namespace }}"
subjects:
- kind: ServiceAccount
  name: resource-operator-controller-manager-job
  namespace: "{{ ansible_operator_meta.namespace }}"
roleRef:
  kind: Role
  name: resource-operator-controller-manager-job
  namespace: "{{ ansible_operator_meta.namespace }}"
  apiGroup: rbac.authorization.k8s.io
