Skip to content

Commit fa7cbe7

Browse files
authored
Add support to choosing the GCP subnet to deploy to. (#132)
Signed-off-by: Jesus Perez Rey <[email protected]> Signed-off-by: Jesus Perez Rey <[email protected]>
1 parent 76952bd commit fa7cbe7

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

roles/common/defaults/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ common__azure_netapp_nfs_version: "{{ infra.azure.netapp.nfs.version | d
137137
# GCP Infra
138138
common__gcp_project: "{{ infra.gcp.project | default('gcp-se') }}"
139139
common__gcp_region: "{{ infra.gcp.region | default('europe-west1') }}"
140+
common__gcp_subnet_id: "{{ infra.gcp.vpc.subnet_id | default(None) }}"
140141

141142
# Plat
142143
common__xaccount_credential_suffix: "{{ env.cdp.credential.suffix | default(common__xaccount_suffix) }}"

roles/platform/defaults/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ plat__aws_policy_urls: "{{ plat__aws_policy_urls_default
148148

149149
# GCP
150150
plat__gcp_project: "{{ common__gcp_project }}"
151+
plat__gcp_subnet_id: "{{ common__gcp_subnet_id }}"
151152

152153
plat__gcp_role_suffix: "{{ env.gcp.role.suffix | default(common__role_suffix) }}"
153154
plat__gcp_storage_suffix: "{{ env.gcp.storage.suffix | default(common__storage_suffix) }}"

roles/platform/tasks/setup_gcp_env.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
log_identity: "{{ plat__gcp_log_identity_name }}@{{ plat__gcp_project }}.iam.gserviceaccount.com"
2828
vpc_id: "{{ plat__vpc_name }}"
2929
subnet_ids:
30-
- "{{ plat__gcp_subnets_discovered[0].name }}" # TODO - Check in validation_gcp.yml -- CDP on GCP only supports a single subnet deployment
30+
- "{{ 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
3131
project: "{{ plat__gcp_project }}"
3232
tunnel: "{{ plat__tunnel }}"
3333
workload_analytics: "{{ plat__workload_analytics }}"

0 commit comments

Comments
 (0)