communishift: Added task for creating Openshift Role, RoleBindings
Signed-off-by: David Kirwan <dkirwan@redhat.com> Signed-off-by: Lenka Segura <lsegura@redhat.com> Signed-off-by: Patrik Polakovic <ppolakov@redhat.com>
This commit is contained in:
parent
d66d362cb0
commit
ccafc89498
3 changed files with 61 additions and 0 deletions
40
roles/communishift/tasks/create-role-binding.yml
Normal file
40
roles/communishift/tasks/create-role-binding.yml
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
---
|
||||||
|
- name: Create a k8s RoleBinding for group namespace permissions
|
||||||
|
community.okd.k8s:
|
||||||
|
api_key: "{{ communishift_ocp_api_token }}"
|
||||||
|
host: "{{ communishift_ocp_api_host }}"
|
||||||
|
state: present
|
||||||
|
definition:
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: RoleBinding
|
||||||
|
metadata:
|
||||||
|
name: "{{ communishift_project_name }}-group-rolebinding"
|
||||||
|
namespace: "{{ communishift_project_name }}"
|
||||||
|
roleRef:
|
||||||
|
apiGroup: rbac.authorization.k8s.io
|
||||||
|
kind: ClusterRole
|
||||||
|
name: admin
|
||||||
|
subjects:
|
||||||
|
- apiGroup: rbac.authorization.k8s.io
|
||||||
|
kind: Group
|
||||||
|
name: "{{ communishift_project_name }}-admins"
|
||||||
|
|
||||||
|
- name: Create a k8s RoleBinding for storage permissions
|
||||||
|
community.okd.k8s:
|
||||||
|
api_key: "{{ communishift_ocp_api_token }}"
|
||||||
|
host: "{{ communishift_ocp_api_host }}"
|
||||||
|
state: present
|
||||||
|
definition:
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: RoleBinding
|
||||||
|
metadata:
|
||||||
|
name: "{{ communishift_project_name }}-efs-rolebinding"
|
||||||
|
namespace: "{{ communishift_project_name }}"
|
||||||
|
roleRef:
|
||||||
|
apiGroup: rbac.authorization.k8s.io
|
||||||
|
kind: Role
|
||||||
|
name: "{{ communishift_project_name }}-efs-role"
|
||||||
|
subjects:
|
||||||
|
- apiGroup: rbac.authorization.k8s.io
|
||||||
|
kind: Group
|
||||||
|
name: "{{ communishift_project_name }}-admins"
|
19
roles/communishift/tasks/create-role.yml
Normal file
19
roles/communishift/tasks/create-role.yml
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
---
|
||||||
|
- name: Create a k8s Role
|
||||||
|
community.okd.k8s:
|
||||||
|
api_key: "{{ communishift_ocp_api_token }}"
|
||||||
|
host: "{{ communishift_ocp_api_host }}"
|
||||||
|
state: present
|
||||||
|
definition:
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: Role
|
||||||
|
metadata:
|
||||||
|
name: "{{ communishift_project_name }}-efs-role"
|
||||||
|
namespace: "{{ communishift_project_name }}"
|
||||||
|
rules:
|
||||||
|
- apiGroups:
|
||||||
|
- aws-efs.managed.openshift.io
|
||||||
|
resources:
|
||||||
|
- '*'
|
||||||
|
verbs:
|
||||||
|
- '*'
|
|
@ -9,3 +9,5 @@
|
||||||
- include_tasks: create-group.yml
|
- include_tasks: create-group.yml
|
||||||
- include_tasks: create-efs.yml
|
- include_tasks: create-efs.yml
|
||||||
- include_tasks: create-efs-secret.yml
|
- include_tasks: create-efs-secret.yml
|
||||||
|
- include_tasks: create-role.yml
|
||||||
|
- include_tasks: create-role-binding.yml
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue