Decommissioning GCP resources
All the tasks to decommission GCP will be contained in one single playbook, where the most relevant difference versus the build playbook is the usage of state: absent (instead of present). Because of the resource dependency, it’s important to define the tasks in the proper order, inside out.
- Create a new
pb_gcp_env_destroy.ymlplaybook with the same structure as the other playbooks, with thereadof the vault encrypted JSON file and the final handler to clean it up. But now, let’s use a new setup using well-known environmental variables for the GCP library that saves some credential specification in every task:root@cookbook-lab:~/cookbook-lab/chapters/ch10# vi pb_gcp_env_destroy.yml ... omitted output ... environment: GCP_SERVICE_ACCOUNT_FILE: “{{ service_account_file }}” GCP_AUTH_KIND: ‘serviceaccount&...