How redhat-cop/infra.aap_configuration works
Purpose and execution model
infra.aap_configuration is an Ansible collection for configuration-as-code of Ansible Automation Platform (AAP) 2.5+. It applies declarative object definitions to AAP services through certified Ansible collections, rather than hosting an application itself. Primary packaged entry point: playbooks/configure_aap.yml; utility entry points include playbooks/get_stats.yml, playbooks/rename_objects.yaml, and playbooks/set_organization.yaml.
Dispatch orchestration
The dispatch role is the high-level ingestion and routing layer. It discovers configuration variables, including wildcard/file-tree input, then invokes the applicable domain roles. This is the main boundary between user-provided YAML inventory/vars and service-specific configuration operations.
• roles/dispatch/tasks/main.yml
• roles/dispatch/tasks/include_wildcard_vars.yml
• roles/dispatch/vars/main.yml
Shared configuration and execution behavior
Global defaults establish common AAP connection and behavioral variables; ansible_config produces local Ansible runtime configuration. Asynchronous role operations centralize result polling/error aggregation in collect_async_status, supporting either fail-fast behavior or collection into aap_configuration_role_errors.
• roles/global_vars/defaults/main.yml
• roles/ansible_config/tasks/main.yml
• roles/collect_async_status/tasks/main.yml
Automation Controller configuration
The largest domain is Controller object lifecycle management: organizations, users/teams/RBAC, credentials, projects, inventories/hosts, execution environments, templates, schedules, and workflows. Individual roles translate typed lists of desired objects into ansible.controller module calls; object dependencies imply ordering such as organizations → identities/access → credentials/projects/inventories → templates/workflows.
• roles/controller_organizations/tasks/main.yml
• roles/controller_job_templates/tasks/main.yml
• roles/controller_workflow_job_templates/tasks/main.yml
Controller execution operations
Separate command roles launch, cancel, bulk-launch, or update runtime Controller resources after definitions exist. These are action-oriented boundaries, distinct from the idempotent desired-state roles.
• roles/controller_job_launch/tasks/main.yml
• roles/controller_bulk_job_launch/tasks/main.yml
• roles/controller_inventory_source_update/tasks/main.yml
Event-Driven Ansible and platform gateway
EDA roles manage EDA identities, credential types/credentials, projects, event streams, decision environments, controller tokens, and rulebook activations. Gateway roles configure the AAP platform gateway’s auth, organizations, RBAC, routes, HTTP ports, services, service clusters/nodes/keys, and settings. They rely respectively on ansible.eda and ansible.platform APIs.
• roles/eda_rulebook_activations/tasks/main.yml
• roles/eda_controller_tokens/tasks/main.yml
• roles/gateway_services/tasks/main.yml
• roles/gateway_authenticators/tasks/main.yml
Automation Hub configuration
Hub roles manage content and access: namespaces, collections and remotes/repositories/sync, execution-environment registries/images/repositories/sync, plus users/groups/roles. This boundary uses ansible.hub modules and potentially external collection or container registries as configured inputs.
• roles/hub_collection_repository/tasks/main.yml
• roles/hub_ee_registry/tasks/main.yml
• roles/hub_publish/tasks/main.yml
Packaging, dependencies, and infrastructure
The collection is packaged for Ansible Galaxy (galaxy.yml) and declares runtime constraints in meta/runtime.yml. Required external collections are ansible.platform, ansible.hub, ansible.controller (>=4.6), and ansible.eda; target infrastructure is authenticated AAP endpoints, preferably via OAuth token. GitHub Actions provide pre-commit and automated release workflows.
• galaxy.yml
• meta/runtime.yml
• .github/workflows/release_auto.yml
Components 23
Entry points
- Configure AAP playbook · Primary packaged configuration entry point.
playbooks/configure_aap.yml - Utility playbooks · Statistics and object-maintenance entry points.
playbooks/get_stats.yml
Shared orchestration
- Global defaults · AAP connection and common behavior variables.
roles/global_vars/defaults/main.yml - Ansible runtime config · Produces local Ansible runtime configuration.
roles/ansible_config/tasks/main.yml - Dispatch · Discovers configuration variables and routes them to domain roles.
roles/dispatch/tasks/main.yml - Wildcard variable ingestion · Loads wildcard and file-tree configuration input.
roles/dispatch/tasks/include_wildcard_vars.yml - Async status collection · Polls results and either fails fast or aggregates role errors.
roles/collect_async_status/tasks/main.yml
Automation Controller
- Controller foundations · Organizations, identities, RBAC, credentials, projects, and inventories.
roles/controller_organizations/tasks/main.yml - Controller job templates · Defines job templates after their dependent resources.
roles/controller_job_templates/tasks/main.yml - Controller workflows · Defines workflow job templates.
roles/controller_workflow_job_templates/tasks/main.yml - Controller runtime operations · Launches jobs and updates inventory sources after definitions exist.
roles/controller_job_launch/tasks/main.yml - ansible.controller API
EDA, Gateway, and Hub
- EDA configuration · Manages EDA identities, projects, streams, environments, and activations.
roles/eda_rulebook_activations/tasks/main.yml - EDA Controller tokens · Configures Controller tokens for EDA integration.
roles/eda_controller_tokens/tasks/main.yml - ansible.eda API
- Platform Gateway · Configures gateway auth, RBAC, routes, services, and settings.
roles/gateway_services/tasks/main.yml - ansible.platform API
- Automation Hub · Manages content, registries, repositories, sync, and access.
roles/hub_collection_repository/tasks/main.yml - ansible.hub API
- AAP endpoints · Authenticated Controller, EDA, Gateway, and Hub services.
Packaging and delivery
- Galaxy collection package · Defines collection packaging and dependencies.
galaxy.yml - Runtime constraints
meta/runtime.yml - Automated release
.github/workflows/release_auto.yml
Connections 30
- Configure AAP playbook → Global defaults: loads defaults
- Configure AAP playbook → Ansible runtime config: configures runtime
- Configure AAP playbook → Dispatch: starts routing
- Utility playbooks → Dispatch: uses configuration routing
- Global defaults → Dispatch: supplies connection defaults
- Ansible runtime config → Dispatch: prepares execution
- Dispatch → Wildcard variable ingestion: includes input trees
- Dispatch → Controller foundations: routes Controller definitions
- Dispatch → Controller runtime operations: routes Controller actions
- Dispatch → EDA configuration: routes EDA definitions
- Dispatch → Platform Gateway: routes Gateway definitions
- Dispatch → Automation Hub: routes Hub definitions
- Controller foundations → Controller job templates: provides dependencies
- Controller job templates → Controller workflows: provides workflow targets
- Controller job templates → Controller runtime operations: defines action targets
- Controller foundations → ansible.controller API: applies via
- Controller job templates → ansible.controller API: applies via
- Controller runtime operations → ansible.controller API: acts via
- EDA configuration → EDA Controller tokens: integrates with Controller
- EDA configuration → ansible.eda API: applies via
- EDA Controller tokens → ansible.eda API: applies via
- Platform Gateway → ansible.platform API: applies via
- Automation Hub → ansible.hub API: applies via
- ansible.controller API → AAP endpoints: configures
- ansible.eda API → AAP endpoints: configures
- ansible.platform API → AAP endpoints: configures
- ansible.hub API → AAP endpoints: configures
- Dispatch → Async status collection: collects async results
- Galaxy collection package → Runtime constraints: declares runtime support
- Automated release → Galaxy collection package: publishes