cloudera-labs / cloudera.exe

cloudera.exe -- an Ansible collection enabling runlevel management of CDP Public Cloud deployments as well as numerous utilities for deployments.
Apache License 2.0
11 stars 27 forks source link

Allow skipping GCP availability zones validation. #150

Closed chusopr closed 10 months ago

chusopr commented 1 year ago

This PR adds a new property infra.gcp.check_availability_zones which would allow skipping the tasks that list GCP availability zones and check if the one we are trying to deploy to exists there. This is being introduced because listing availability zones may be blocked by organization policies making this task fail.

Also, the original code was listing availability zones unconditionally but was checking if the chosen availability zone is present in that list only if an availability zone was provided (plat__gcp_availability_zones | length > 0). This PR also moves that condition to apply it to the the whole block and not only the last task so listing availability zones is also skipped when no availability zones were chosen.

This was tested by trying to deploy a cluster to an invalid availability zone with infra.gcp.check_availability_zones unset to confirm that it still fails while validating availability zones as before and also trying to deploy a cluster to an invalid availability zone with infra.gcp.check_availability_zones set to true which fails when it tries to deploy the environment to GCP as expected.