Skip to content

Commit 8582f67

Browse files
cmperroChris Perro
authored andcommitted
Updates to authz setup and teardown for deleting custom role, and scoping ad app down to the rg
Signed-off-by: Chris Perro <[email protected]>
1 parent a4623b2 commit 8582f67

File tree

4 files changed

+38
-1
lines changed

4 files changed

+38
-1
lines changed

roles/platform/defaults/main.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,11 +177,16 @@ plat__azure_storage_name: "{{ common__azure_storage_name }}"
177177

178178
plat__azure_consistency_wait: "{{ env.azure.app.wait | default(30) }}"
179179
<<<<<<< HEAD
180+
<<<<<<< HEAD
180181
plat__azure_xaccount_use_custom_role: "{{ env.azure.use_custom_role | default(False) }}"
181182
plat__azure_xaccount_rg_scope: "{{ env.azure.rg_scope | default(False) }}"
182183
=======
183184
plat__azure_xaccount_use_custom_role: "{{ env.azure.app.use_custom_role | default(False) }}"
184185
>>>>>>> 77d54e8 (Remove Cred/AD App during teardown. Rework Cred/AD App AuthZ)
186+
=======
187+
plat__azure_xaccount_use_custom_role: "{{ env.azure.use_custom_role | default(False) }}"
188+
plat__azure_xaccount_rg_scope: "{{ env.azure.rg_scope | default(False) }}"
189+
>>>>>>> 374439c (Updates to authz setup and teardown for deleting custom role, and scoping ad app down to the rg)
185190
plat__azure_single_resource_group: "{{ env.azure.single_resource_group | default(False) }}"
186191
plat__azure_xaccount_app_name: "{{ env.azure.app.name | default([plat__namespace, plat__azure_xaccount_suffix, plat__azure_app_suffix] | join('-')) }}"
187192
plat__azure_xaccount_role_name: "{{ env.azure.role.name.cross_account | default([plat__namespace, plat__azure_xaccount_suffix, plat__azure_role_suffix] | join('-')) }}"

roles/platform/tasks/setup_azure_authz.yml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
ansible.builtin.pause:
4646
seconds: "{{ plat__azure_consistency_wait }}"
4747
<<<<<<< HEAD
48+
<<<<<<< HEAD
4849

4950
=======
5051

@@ -54,13 +55,17 @@
5455

5556
# Owner role is required for DWX if you are thinking of modifying this task
5657
>>>>>>> 77d54e8 (Remove Cred/AD App during teardown. Rework Cred/AD App AuthZ)
58+
=======
59+
60+
>>>>>>> 374439c (Updates to authz setup and teardown for deleting custom role, and scoping ad app down to the rg)
5761
- name: Request Azure Cross Account App Creation
5862
no_log: True
5963
register: __azure_xaccount_app_info
6064
command: >
6165
az ad sp create-for-rbac
6266
--name {{ plat__azure_xaccount_app_name }}
6367
--role {{ plat__azure_xaccount_use_custom_role | ternary(__azure_xaccount_role_info.id, plat__azure_roles.contrib) }}
68+
<<<<<<< HEAD
6469
<<<<<<< HEAD
6570
--scope {{ plat__azure_xaccount_rg_scope | ternary(plat__azure_metagroup_uri, plat__azure_subscription_uri) }}
6671
=======
@@ -73,6 +78,9 @@
7378
# command: >
7479
# sleep 180
7580
>>>>>>> 77d54e8 (Remove Cred/AD App during teardown. Rework Cred/AD App AuthZ)
81+
=======
82+
--scope {{ plat__azure_xaccount_rg_scope | ternary(plat__azure_metagroup_uri, plat__azure_subscription_uri) }}
83+
>>>>>>> 374439c (Updates to authz setup and teardown for deleting custom role, and scoping ad app down to the rg)
7684

7785
- name: Register Azure Cross Account App info
7886
no_log: True
@@ -129,6 +137,7 @@
129137
<<<<<<< HEAD
130138
=======
131139

140+
<<<<<<< HEAD
132141
#Move Up
133142
#- name: Handle Azure Cross Account Role
134143
# register: __azure_xaccount_role_info
@@ -148,6 +157,8 @@
148157
# plat__azure_xaccount_role_uri: "{{ __azure_xaccount_role_info.id }}"
149158
>>>>>>> 77d54e8 (Remove Cred/AD App during teardown. Rework Cred/AD App AuthZ)
150159

160+
=======
161+
>>>>>>> 374439c (Updates to authz setup and teardown for deleting custom role, and scoping ad app down to the rg)
151162
- name: Request creation of Azure Managed Identities
152163
when: ( __azure_identity_list_names is undefined ) or ( __azure_msi_item not in __azure_identity_list_names )
153164
loop_control:
@@ -159,7 +170,7 @@
159170
- "{{ plat__azure_datalakeadmin_identity_name }}"
160171
- "{{ plat__azure_log_identity_name }}"
161172
- "{{ plat__azure_ranger_audit_identity_name }}"
162-
#Dupe of Below?
173+
163174
- name: Wait for identities to be listed
164175
command: "az identity list -g {{ plat__azure_metagroup_name }}"
165176
register: __azure_identity_list
@@ -271,6 +282,7 @@
271282
scope: "{{ plat__azure_datapath_uri }}"
272283
assignee: "{{ __azure_ranger_audit_identity_uuid }}"
273284
desc: Assign Storage Blob Data Contributor Role to Ranger Role at Data Container level
285+
<<<<<<< HEAD
274286
<<<<<<< HEAD
275287
loop_control:
276288
loop_var: __azure_rl_assgn_item
@@ -298,3 +310,8 @@
298310
# command: >
299311
# sleep 1800
300312
>>>>>>> 77d54e8 (Remove Cred/AD App during teardown. Rework Cred/AD App AuthZ)
313+
=======
314+
loop_control:
315+
loop_var: __azure_rl_assgn_item
316+
label: "{{ __azure_rl_assgn_item.desc }}"
317+
>>>>>>> 374439c (Updates to authz setup and teardown for deleting custom role, and scoping ad app down to the rg)

roles/platform/tasks/setup_azure_env.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,15 @@
3030
vpc_id: "{{ plat__vpc_name }}"
3131
tunnel: "{{ plat__tunnel }}"
3232
resource_gp: "{{ plat__azure_metagroup_name }}"
33+
<<<<<<< HEAD
3334
<<<<<<< HEAD
3435
use_single_resource_group: "{{ plat__azure_single_resource_group or plat__azure_xaccount_rg_scope | bool }}"
3536
=======
3637
use_single_resource_group: "{{ plat__azure_single_resource_group }}"
3738
>>>>>>> 77d54e8 (Remove Cred/AD App during teardown. Rework Cred/AD App AuthZ)
39+
=======
40+
use_single_resource_group: "{{ plat__azure_single_resource_group or plat__azure_xaccount_rg_scope | bool }}"
41+
>>>>>>> 374439c (Updates to authz setup and teardown for deleting custom role, and scoping ad app down to the rg)
3842
subnet_ids: "{{ plat__azure_subnets }}"
3943
public_ip: "{{ plat__public_endpoint_access }}"
4044
tags: "{{ plat__tags }}"

roles/platform/tasks/teardown_azure_authz.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
when: plat__teardown_deletes_credential
5656
cloudera.cloud.env_cred:
5757
state: absent
58+
<<<<<<< HEAD
5859
<<<<<<< HEAD
5960
name: "{{ plat__xacccount_credential_name }}"
6061
=======
@@ -65,19 +66,29 @@
6566
#application: "{{ plat__azure_xaccount_app_uuid }}"
6667
#secret: "{{ __azure_xaccount_app_pword }}"
6768
>>>>>>> 77d54e8 (Remove Cred/AD App during teardown. Rework Cred/AD App AuthZ)
69+
=======
70+
name: "{{ plat__xacccount_credential_name }}"
71+
>>>>>>> 374439c (Updates to authz setup and teardown for deleting custom role, and scoping ad app down to the rg)
6872

6973
- name: Tear down Azure AD App Registration
7074
when: plat__teardown_deletes_xaccount and ( plat__azure_xaccount_app_uuid is defined ) and ( plat__azure_xaccount_app_uuid | length > 0 )
7175
command: >
7276
az ad sp delete
7377
<<<<<<< HEAD
78+
<<<<<<< HEAD
79+
=======
80+
>>>>>>> 374439c (Updates to authz setup and teardown for deleting custom role, and scoping ad app down to the rg)
7481
--id {{ plat__azure_application_service_principal_objuuid }}
7582

7683
- name: Tear down Custom Role
7784
when: plat__teardown_deletes_roles
7885
azure.azcollection.azure_rm_roledefinition:
7986
state: absent
87+
<<<<<<< HEAD
8088
name: "{{ plat__azure_xaccount_role_name }}"
8189
=======
8290
--id {{ plat__azure_application_service_principal_objuuid }}
8391
>>>>>>> 77d54e8 (Remove Cred/AD App during teardown. Rework Cred/AD App AuthZ)
92+
=======
93+
name: "{{ plat__azure_xaccount_role_name }}"
94+
>>>>>>> 374439c (Updates to authz setup and teardown for deleting custom role, and scoping ad app down to the rg)

0 commit comments

Comments
 (0)