What do the Azure and GCP dynamic inventory plugins look like?
IntermediateProductionAWX, AAP and Cloud Integration
Answer
Same idea as aws_ec2: a YAML file whose name ends in the plugin's suffix, using cloud labels or tags for groups.
# prod.azure_rm.yml
plugin: azure.azcollection.azure_rm
include_vm_resource_groups: [rg-prod-web]
auth_source: auto
keyed_groups:
- prefix: tag_role
key: tags.role | default('none')
# prod.gcp.yml
plugin: google.cloud.gcp_compute
projects: [acme-prod]
auth_kind: application
filters:
- status = RUNNING
keyed_groups:
- prefix: role
key: labels.role
hostnames: [private_ip, name]
Use managed identity on Azure and workload identity or a service account on GCP rather than key files. Check with ansible-inventory -i prod.gcp.yml --graph.
More on AWX, AAP and Cloud Integration
AWX or Red Hat Ansible Automation Platform: what is the difference and what do you pay for?BeginnerWhat are the core objects in AWX and how do they fit together?BeginnerHow do you manage AWX configuration as code?IntermediateHow do custom credential types work in AWX?AdvancedHow do you connect AWX to an external secrets manager?IntermediateHow do you trigger AWX jobs from CI or other systems?Intermediate