Introduction
google.cloud is the Ansible Collection that provides modules and plugins for managing Google Cloud Platform resources: Compute Engine instances, Cloud SQL, Cloud Storage, VPC networking, and more, all driven from Ansible playbooks via the GCP APIs. Version 1.16.0 has been published to Ansible Galaxy, moving up from 1.15.0. This release introduces a new signed-URL module for Cloud Storage, two new Network Connectivity Center modules, an edition option for Cloud SQL instances, and a sizeable set of fixes to the collection's internal audit/compliance tooling.
Whats New
Minor Changes
- Added
gcp_storage_signed_urlmodule - generates a V4 signed URL for a GCS object, so a party without any IAM access to the bucket can perform a single HTTP request against that object until the URL expires. Signing can be done via the IAM Credentials API (signBlob, using a service account other than the one running the module) or locally via an HMAC key, with no IAM API call and noserviceAccountTokenCreatorgrant required for the latter. audit- addedtests/unit/audit/test_event_query_contract.py, asserting the constraints the controller imposes on the query file (PR #781).audit- dropped the mappings forgcp_resource_record_setandgcp_sourcerepo_repository; neither module exists in this collection (PR #781).event_query- the contract test now compiles every expression withjq, instead of only reading the query as text, which previously allowed an expression that cannot actually run to pass.gcp_networkconnectivity_*- addedgcp_networkconnectivity_hubandgcp_networkconnectivity_spoke, with accompanying_infomodules (PR #788).gcp_sql_instance- addededitionoption undersettings(e.g.ENTERPRISE,ENTERPRISE_PLUS) to allow specifying the Cloud SQL instance edition (PR #784).
Bugfixes
ansible-mmv1(templates)- reverted to a 3-way boolean check for custom diff logic, so a custom diff can be forced even when the values aren't actually different.ansible-mmv1(templates)- fixed theDOCUMENTATIONblock incorrectly printingshort_descriptionat the end of the block due to alphabetical ordering (issue #789, fix commit).ansible-mmv1(templates)- fixed theRETURNSblock showing incomplete output (commit).audit-device_typewas looked up by the resourcekind, which no module'sresponse_to_hash()returns, so every resource would have been labelledmissing. Each module now carries its resource type literally (PR #781).audit-gcp_container_clusterandgcp_container_node_poolwere keyed on.name, which the GKE API returns as the short name only. Same-named node pools in different clusters, and same-named clusters in different projects or locations, collapsed into a single indirect node, and because the controller requiresnameto be unique within a job, a job touching two of them lost every audit record it produced. Both now key on the full resource identity (.id/.selfLink) (PR #781).audit-gcp_dns_resource_record_setguarded only.name, so a result carrying no.typeemitted the identifier"<name>/null"(sincenull | tostringis the string"null", not null), and every such record in a job collided on the same identifier..typeis now guarded as well (PR #781).audit-gcp_dns_resource_record_setwas identified by name alone, so an A record and a TXT record on the same name (two distinct resources) were collapsed into one (PR #781).audit-namewas part ofcanonical_facts, the only key the controller deduplicates on, so a renamed resource was counted twice (PR #781).audit- the identifier fell back toetagwhen a module returned noid. Sinceetagchanges on every mutation,gcp_filestore_instance- the only module in the collection that returns noid- was affected by this fallback behavior (PR #781).
Component Overview
| Area | Change | Reference |
|---|---|---|
gcp_storage_signed_url | New module for V4 signed GCS URLs | n/a |
gcp_networkconnectivity_hub / _spoke (+ _info) | New modules for Network Connectivity Center | PR #788 |
gcp_sql_instance | New edition option under settings | PR #784 |
audit internals | Multiple identity/dedup fixes across GKE, DNS, Filestore, and resource-type lookup | PR #781 |
ansible-mmv1 templates | DOCUMENTATION/RETURNS block generation fixes, custom diff logic reverted | issue #789 |
How to Test
Install or upgrade the collection from Ansible Galaxy and confirm the version reported matches 1.16.0.
# Install the specific version
ansible-galaxy collection install google.cloud:1.16.0
# Or upgrade to the latest available version
ansible-galaxy collection install google.cloud --upgrade
# Verify the installed version
ansible-galaxy collection list google.cloud
# Inspect the new signed URL module documentation
ansible-doc google.cloud.gcp_storage_signed_url
# Inspect the new Network Connectivity Center modules
ansible-doc google.cloud.gcp_networkconnectivity_hub
ansible-doc google.cloud.gcp_networkconnectivity_spoke
For automation controller users relying on the audit/event_query tooling bundled with this collection, re-run any affected jobs touching GKE clusters/node pools, DNS resource record sets, or Filestore instances after upgrading, since several of the fixes above directly change how those resources are deduplicated and identified.