diff options
author | Scott Dodson <sdodson@redhat.com> | 2017-10-20 11:02:23 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-20 11:02:23 -0400 |
commit | 94a75431044d6124dcb22659cbecbb09c3cb3a38 (patch) | |
tree | 22f83883627f562e42e775f029a2415cafba60d9 /roles/kuryr/tasks/serviceaccount.yaml | |
parent | 30d3fc6ed990c8e9f13b4e96e6e7acff13500e1e (diff) | |
parent | e6ea6839a8f657c1266c25ba4aba43c837329fa3 (diff) | |
download | openshift-94a75431044d6124dcb22659cbecbb09c3cb3a38.tar.gz openshift-94a75431044d6124dcb22659cbecbb09c3cb3a38.tar.bz2 openshift-94a75431044d6124dcb22659cbecbb09c3cb3a38.tar.xz openshift-94a75431044d6124dcb22659cbecbb09c3cb3a38.zip |
Merge pull request #5574 from dulek/containerized_kuryr_support
Initial Kuryr support
Diffstat (limited to 'roles/kuryr/tasks/serviceaccount.yaml')
-rw-r--r-- | roles/kuryr/tasks/serviceaccount.yaml | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/roles/kuryr/tasks/serviceaccount.yaml b/roles/kuryr/tasks/serviceaccount.yaml new file mode 100644 index 000000000..088f13091 --- /dev/null +++ b/roles/kuryr/tasks/serviceaccount.yaml @@ -0,0 +1,31 @@ +--- +- name: Create Controller service account + oc_serviceaccount: + name: kuryr-controller + namespace: "{{ kuryr_namespace }}" + register: saout + +- name: Create a role for the Kuryr + oc_clusterrole: "{{ kuryr_clusterrole }}" + +- name: Fetch the created Kuryr controller cluster role + oc_clusterrole: + name: kuryrctl + state: list + register: crout + +- name: Grant Kuryr the privileged security context constraints + oc_adm_policy_user: + user: "system:serviceaccount:{{ kuryr_namespace }}:{{ saout.results.results.0.metadata.name }}" + namespace: "{{ kuryr_namespace }}" + resource_kind: scc + resource_name: privileged + state: present + +- name: Assign role to Kuryr service account + oc_adm_policy_user: + user: "system:serviceaccount:{{ kuryr_namespace }}:{{ saout.results.results.0.metadata.name }}" + namespace: "{{ kuryr_namespace }}" + resource_kind: cluster-role + resource_name: "{{ crout.results.results.metadata.name }}" + state: present |