Interview Prep/Ansible/AWX, AAP and Cloud Integration

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.

All Ansible questions Roadmap: Ansible

More on AWX, AAP and Cloud Integration