File tree Expand file tree Collapse file tree 4 files changed +56
-33
lines changed
ansible/roles/keystone_bootstrap Expand file tree Collapse file tree 4 files changed +56
-33
lines changed Original file line number Diff line number Diff line change @@ -4,18 +4,44 @@ keystone_bootstrap_dex_url: "{{ dex_url | default('https://dex.' + lookup('ansib
44keystone_bootstrap_groups :
55 - name : ucadmin
66 desc : ' Users Federated with Admin'
7- roles :
8- - member
9- - admin
7+ domain_roles :
8+ # grants admin role to the infra domain and child projects like baremetal
9+ # this is for full access in ironic
10+ - domain : infra
11+ role : admin
12+ inherited : true
13+ # grants member role to the infra domain and child projects like baremetal
14+ # this allows manipulating resources like images and networks for ironic usage
15+ - domain : infra
16+ role : member
17+ inherited : true
18+ # grants manager role to the default domain so that projects can be created
19+ - domain : default
20+ role : manager
21+ # grants member role to the default domain and child projects where normal tenants live
22+ # TODO: remove this because admins might not be the same people touching tenants
23+ - domain : default
24+ role : member
25+ inherited : true
1026 - name : ucuser
1127 desc : ' Regular Federated Users'
12- roles :
13- - member
28+ domain_roles :
29+ # grants member role to the default domain and child projects where normal tenants live
30+ - domain : default
31+ role : member
32+ inherited : true
1433 - name : ucneteng
1534 desc : ' Federated Network Engineers'
16- roles :
17- - member
35+ domain_roles :
36+ # grants member role to the default domain and child projects where normal tenants live
37+ - domain : default
38+ role : member
39+ inherited : true
1840 - name : ucdctech
1941 desc : ' Federated DC Technicians'
20- roles :
21- - member
42+ domain_roles :
43+ # grants member role to the infra domain and child projects like baremetal
44+ # this allows manipulating resources like images and networks for ironic usage
45+ - domain : infra
46+ role : member
47+ inherited : true
Original file line number Diff line number Diff line change 5757 mapping : sso_mapping
5858
5959- name : Create federated group mappings
60- ansible.builtin.include_tasks : sso_member_groups .yml
60+ ansible.builtin.include_tasks : sso_groups .yml
6161 loop : " {{ keystone_bootstrap_groups }}"
62-
63- - name : Grant admin for groups
64- ansible.builtin.include_tasks : sso_role_admin.yml
65- loop :
66- - ucadmin
62+ loop_control :
63+ loop_var : group_item
Original file line number Diff line number Diff line change 1313# License for the specific language governing permissions and limitations
1414# under the License.
1515#
16- - name : Find group
17- openstack.cloud.identity_group_info :
18- name : " {{ item }}"
19- domain : " {{ _domain_sso.domain.id }}"
2016
2117# role assignment module is lacking inherited and cross domain assignments
22- - name : Assign member access
23- ansible.builtin.command : openstack role add -- group "{{ _group.group.id }}" -- domain default --inherited admin
24- when : dont_set_roles is not defined
25- changed_when : false
26-
27- # role assignment module is lacking inherited and cross domain assignments
28- - name : Assign member access
29- ansible.builtin.command : openstack role add --group "{{ _group.group.id }}" --domain infra --inherited admin
18+ # so need to do this manually
19+ - name : Assign role to group for domain
20+ ansible.builtin.command : >
21+ openstack role add --group "{{ group_id }}" --domain "{{ role_item.domain }}"
22+ {% if role_item.inherited | default(false) | bool %}
23+ -- inherited
24+ {% endif %}
25+ "{{ role_item.role }}"
3026 when : dont_set_roles is not defined
3127 changed_when : false
Original file line number Diff line number Diff line change 1515
1616- name : Create group
1717 openstack.cloud.identity_group :
18- name : " {{ item .name }}"
18+ name : " {{ group_item .name }}"
1919 domain_id : " {{ _domain_sso.domain.id }}"
20- description : " {{ item .desc }}"
20+ description : " {{ group_item .desc }}"
2121 state : present
2222 register : _group
2323
2424# role assignment module is lacking inherited and cross domain assignments
25- - name : Assign member access
26- ansible.builtin.command : openstack role add --group "{{ _group.group.id }}" --domain default --inherited member
27- when : dont_set_roles is not defined
28- changed_when : false
25+ # so need to do this manually done
26+ - name : Assign role to group for domain
27+ ansible.builtin.include_tasks : sso_domain_role.yml
28+ loop : " {{ group_item.domain_roles }}"
29+ loop_control :
30+ loop_var : role_item
31+ vars :
32+ group_id : " {{ _group.group.id }}"
You can’t perform that action at this time.
0 commit comments