Skip to content

Commit da16413

Browse files
jimrightchusopr
andauthored
Add support for GCP backup storage bucket (#172)
* Add support for specifying the GCP backups storage bucket * Update backup_location parameter name for GCP env * Remove duplicate plat__data_path variable * Update configuration parameter docs Signed-off-by: Jesus Perez Rey <jprey@bluemetrix.com> Signed-off-by: Jim Enright <jenright@cloudera.com> Co-authored-by: Jesus Perez Rey <jprey@bluemetrix.com>
1 parent af1a17f commit da16413

File tree

7 files changed

+17
-5
lines changed

7 files changed

+17
-5
lines changed

docs/configuration.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,7 @@ env:
268268
suffix:
269269
storage:
270270
path:
271+
backups:
271272
data:
272273
logs:
273274
suffix:
@@ -423,6 +424,7 @@ infra:
423424
region:
424425
storage:
425426
path:
427+
backups:
426428
data:
427429
logs:
428430
security_group:
@@ -438,6 +440,7 @@ infra:
438440
storage:
439441
name:
440442
path:
443+
backups:
441444
data:
442445
de:
443446
logs:

roles/common/defaults/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ common__ml_path: "{{ infra.storage.path.ml | default('d
104104
common__de_path: "{{ infra.storage.path.de | default('dataeng') }}"
105105
common__logs_path: "{{ infra.storage.path.logs | default(common__logs_suffix) }}"
106106
common__data_path: "{{ infra.storage.path.data | default(common__data_suffix) }}"
107+
common__backups_path: "{{ infra.storage.path.backups | default(common__logs_path) }}"
107108
common__ranger_audit_path: "{{ infra.storage.path.ranger_audit | default('ranger/audit') }}"
108109

109110
# AWS Infra

roles/infrastructure/defaults/main.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ infra__storage_name: "{{ common__storage_name }}"
6868

6969
infra__logs_path: "{{ common__logs_path }}"
7070
infra__data_path: "{{ common__data_path }}"
71+
infra__backups_path: "{{ common__backups_path }}"
7172
infra__ranger_audit_path: "{{ common__ranger_audit_path }}"
7273

7374
infra__public_key_path: "{{ globals.ssh.key_path | default('~/.ssh') }}"
@@ -135,8 +136,9 @@ infra__aws_private_endpoints: "{{ infra.aws.vpc.private_endpoints | defaul
135136
# GCP
136137
infra__gcp_project: "{{ common__gcp_project }}"
137138

138-
infra__gcp_storage_location_data: "{{ infra.gcp.storage.path.data | default([infra__storage_name, infra__data_path] | join('-')) }}"
139-
infra__gcp_storage_location_logs: "{{ infra.gcp.storage.path.logs | default([infra__storage_name, infra__logs_path] | join('-')) }}"
139+
infra__gcp_storage_location_data: "{{ infra.gcp.storage.path.data | default([infra__storage_name, infra__data_path] | join('-')) }}"
140+
infra__gcp_storage_location_logs: "{{ infra.gcp.storage.path.logs | default([infra__storage_name, infra__logs_path] | join('-')) }}"
141+
infra__gcp_storage_location_backups: "{{ infra.gcp.storage.path.backups | default(infra__gcp_storage_location_logs) }}"
140142

141143
infra__gcp_cloud_router_name_suffix: "{{ infra.gcp.network.router.name_suffix | default('router') }}"
142144
infra__gcp_cloud_router_name: "{{ infra.gcp.network.router.name | default([infra__namespace, infra__gcp_cloud_router_name_suffix] | join('-')) }}"
@@ -175,4 +177,4 @@ infra__utlity_bucket_name: "{{ globals.utility_bucket_name | default(
175177

176178
# Teardown
177179
infra__force_teardown: "{{ common__force_teardown }}"
178-
infra__env_name: "{{ common__env_name }}" # Used for purge lookups
180+
infra__env_name: "{{ common__env_name }}" # Used for purge lookups

roles/infrastructure/tasks/initialize_gcp.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,12 @@
3838
fail_msg: "Gcloud Collection failed to retrieve resources, you may need to run 'gcloud auth login' or 'gcloud init': {{ __gcp_vpc_info }}"
3939
quiet: yes
4040

41-
- name: Set fact for Log and Data locations
41+
- name: Set fact for Log, Backups and Data locations
4242
ansible.builtin.set_fact:
4343
infra__gcp_storage_locations: "{{ infra__gcp_storage_locations | default([]) | union([__gcp_storage_location_item]) }}"
4444
loop_control:
4545
loop_var: __gcp_storage_location_item
4646
loop:
4747
- "{{ infra__gcp_storage_location_data }}"
48-
- "{{ infra__gcp_storage_location_logs }}"
48+
- "{{ infra__gcp_storage_location_logs }}"
49+
- "{{ infra__gcp_storage_location_backups }}"

roles/platform/defaults/main.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ plat__storage_name: "{{ common__storage_name }}"
5252

5353
plat__logs_path: "{{ common__logs_path }}"
5454
plat__data_path: "{{ common__data_path }}"
55+
plat__backup_path: "{{ common__backups_path }}"
5556

5657
plat__public_key_id: "{{ common__public_key_id }}"
5758
plat__public_key_text: "{{ common__public_key_text }}"
@@ -168,6 +169,7 @@ plat__gcp_idbroker_identity_name: "{{ env.gcp.role.name.idbroker | d
168169

169170
plat__gcp_storage_location_data: "{{ env.gcp.storage.path.data | default([plat__storage_name, plat__data_path] | join('-')) }}"
170171
plat__gcp_storage_location_logs: "{{ env.gcp.storage.path.logs | default([plat__storage_name, plat__logs_path] | join('-')) }}"
172+
plat__gcp_storage_location_backups: "{{ env.gcp.storage.path.backups | default(plat__gcp_storage_location_logs) }}"
171173

172174
plat__gcp_xaccount_policy_bindings: "{{ env.gcp.bindings.cross_account | default(plat__gcp_xaccount_policy_bindings_default) }}"
173175
plat__gcp_log_role_perms: "{{ env.gcp.bindings.logs | default(plat__gcp_log_policy_bindings_default) }}"

roles/platform/tasks/setup_gcp_authz.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,8 @@
167167
loop:
168168
- account: "serviceAccount:{{ plat__gcp_log_identity_name }}@{{ plat__gcp_project }}.iam.gserviceaccount.com:admin"
169169
bucket: "{{ plat__gcp_storage_location_logs }}"
170+
- account: "serviceAccount:{{ plat__gcp_log_identity_name }}@{{ plat__gcp_project }}.iam.gserviceaccount.com:admin"
171+
bucket: "{{ plat__gcp_storage_location_backups }}"
170172
- account: "serviceAccount:{{ plat__gcp_datalakeadmin_identity_name }}@{{ plat__gcp_project }}.iam.gserviceaccount.com:admin"
171173
bucket: "{{ plat__gcp_storage_location_data }}"
172174
- account: "serviceAccount:{{ plat__gcp_ranger_audit_identity_name }}@{{ plat__gcp_project }}.iam.gserviceaccount.com:admin"

roles/platform/tasks/setup_gcp_env.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
public_ip: "{{ plat__use_public_ip }}"
2626
log_location: "gs://{{ plat__gcp_storage_location_logs }}"
2727
log_identity: "{{ plat__gcp_log_identity_name }}@{{ plat__gcp_project }}.iam.gserviceaccount.com"
28+
backup_location: "gs://{{ plat__gcp_storage_location_backups }}"
2829
vpc_id: "{{ plat__vpc_name }}"
2930
subnet_ids:
3031
- "{{ plat__gcp_subnet_id if plat__gcp_subnet_id else plat__gcp_subnets_discovered[0].name }}" # TODO - Check in validation_gcp.yml -- CDP on GCP only supports a single subnet deployment

0 commit comments

Comments
 (0)