Introduction
google.cloud is the Ansible Content Collection that provides modules, inventory plugins, and module utilities for managing Google Cloud Platform resources: Compute Engine, Cloud SQL, AlloyDB, Cloud Build, Vertex AI, IAM, and more, all driven from Ansible playbooks against the GCP APIs. Version 1.15.0 has just landed, replacing 1.14.0, and it brings two new module families plus a round of fixes to the gcp_compute dynamic inventory plugin, particularly around folder-based project resolution.
Whats New
Minor Changes
gcp_alloydb_*- updated to the most recent version generated from MMv1.gcp_binaryauthorization_*- four new modules added for attestor/policy management plus accompanying info modules (PR #782).gcp_cloudbuild_trigger- updated to the most recent version generated from MMv1.gcp_cloudbuildv2_*- updated to the most recent version generated from MMv1.gcp_colab_*- updated to the most recent version generated from MMv1.gcp_computeinventory plugin - now prints an aggregate warning at the end of a sync whenfolders:is used and one or more resolved projects were skipped, summarizing how many out of the total were affected.gcp_containeranalysis_*- two new modules added, a container analysis module and its matching info module (PR #782).gcp_vertexai_*- updated to the most recent version generated from MMv1.
Bugfixes
gcp_computeinventory plugin - deduplicates resolved projects whenfolders:lists both a folder and one of its descendants. Previously, the descendant's projects (and therefore its hosts) were resolved twice.gcp_computeinventory plugin - resolves subfolders recursively when usingfolders:, instead of only the projects that are direct children of the given folder. On hierarchies where the given folder only contains subfolders with no projects directly attached, the plugin previously always returned zero hosts.gcp_computeinventory plugin - skips a project instead of failing the entire inventory sync when a project resolved viafolders:cannot be queried, for example when the Compute Engine API is disabled or access is blocked by a VPC Service Controls perimeter. Any other error still fails the sync as before.module_utils.gcp_v2- fixed a premature encoding bug by moving the encoding step to right before the payload is sent to the API (PR #782).module_utils.gcp_v2- fixed a double decoding bug where async operations were passed through the custom decoder (if any) twice (PR #782).
Affected Components
| Component | Type | Change |
|---|---|---|
| gcp_alloydb_* | Modules | Regenerated from MMv1 |
| gcp_binaryauthorization_* | Modules | 4 new modules (attestor/policy + info) |
| gcp_cloudbuild_trigger | Module | Regenerated from MMv1 |
| gcp_cloudbuildv2_* | Modules | Regenerated from MMv1 |
| gcp_colab_* | Modules | Regenerated from MMv1 |
| gcp_containeranalysis_* | Modules | 2 new modules (analysis + info) |
| gcp_vertexai_* | Modules | Regenerated from MMv1 |
| gcp_compute | Inventory plugin | Folder resolution fixes + aggregate skip warning |
| module_utils.gcp_v2 | Module util | Encoding and double-decoding fixes |
Installing and Verifying google.cloud 1.15.0
# Install or upgrade the collection from Ansible Galaxy
ansible-galaxy collection install google.cloud --upgrade
# Verify the installed version
ansible-galaxy collection list google.cloud
# Alternatively, pin the version explicitly in requirements.yml
cat > requirements.yml <<'EOF'
collections:
- name: google.cloud
version: 1.15.0
EOF
ansible-galaxy collection install -r requirements.yml
# Quick sanity check against the new binauthz module
ansible-doc google.cloud.gcp_binaryauthorization_policy
Testing the gcp_compute Inventory Fixes
Anyone relying on folders: in gcp_compute.yml inventory configs should re-run a sync after upgrading, especially if the folder hierarchy has subfolders without directly attached projects, or if any project in scope has the Compute Engine API disabled or sits behind a VPC Service Controls perimeter.
# Refresh inventory cache and list resolved hosts
ansible-inventory -i gcp_compute.yml --list --playbook-dir=.
# Run with verbosity to see the new aggregate skip warning, if any
ansible-inventory -i gcp_compute.yml --graph -vvv
Review the warning output for the count of skipped projects out of the total resolved, and check that hosts from previously empty subfolder-only hierarchies now appear as expected.