Validating a GCP deployment
Ansible offers various modules to retrieve the operational state of resources in GCP. These modules enable us to programmatically validate the current state of our network resources, eliminating the need to manually log in to the GCP portal and use the Graphical User Interface (GUI) to check the status of deployed components. In this recipe, you will learn how to use specific Ansible modules to validate the network subnets you have provisioned in GCP:
- Create a new
pb_gcp_net_validate.ymlplaybook with a task to validate the VPC subnet information, using a similar skeleton as in the previous one, using the GCP secrets JSON file:root@cookbook-lab:~/cookbook-lab/chapters/ch10# vi pb_gcp_net_validate.yml ... output omitted ... - name: Get Subnet Facts google.cloud.gcp_compute_subnetwork_info: region...