This repository is an Ansible Collection (infra.aap_configuration) that provides roles for managing Ansible Automation Platform 2.5+ resources as code. It targets four AAP components: Automation Controller, Event-Driven Ansible, Automation Hub, and the AAP Gateway.
When reviewing pull requests to this collection, verify the following:
- New roles must follow the established directory layout:
defaults/main.yml,tasks/main.yml,meta/main.yml,meta/argument_specs.yml,README.md, andtests/ meta/main.ymlmust declare dependencies onglobal_varsandmeta_dependency_checkdefaults/main.ymlmust initialize the resource list to[]and include standard variables for secure logging, async retries, async delay, loop delay, enforce defaults, andaap_configuration_async_dir- Role naming must use the correct component prefix:
controller_*,gateway_*,hub_*, oreda_*
All resource roles must follow the async block pattern:
- A block with
ansible_async_dirandno_logset - The module task loops over the resource list with
asyncandpoll: 0 - A "Flag for errors (check mode only)" task using
ansible.builtin.set_factto seterror_flag - An
include_roleofinfra.aap_configuration.collect_async_statusto wait for results, passingcas_async_delay,cas_async_retries,cas_secure_logging,cas_job_async_results_item,cas_register_subvar,cas_error_list_var_name, andcas_object_label - An
alwaysblock that cleans up async result files viaansible.builtin.async_statuswithmode: cleanup
- Internal loop variables use double-underscore prefix:
__<role_name>_item - Async result variables follow:
__<role_name>_job_asyncand__<role_name>_job_async_results_item - Variable names must match pattern
^[a-z_][a-z0-9_]*$ - Loop variable prefix must match
^(__|{role}_)
- Task names must follow the
"{stem} | "prefix pattern enforced by ansible-lint - Example:
"Managing Organizations"for an organizations role task
- Controller roles (
controller_*) must use:controller_host,controller_username,controller_password,controller_oauthtoken,request_timeout,validate_certs - Gateway roles (
gateway_*) must use:gateway_hostname,gateway_username,gateway_password,gateway_token,gateway_request_timeout,gateway_validate_certs - All auth params should use
aap_hostname,aap_username,aap_password,aap_tokenvariables withdefault(omit, true)fallbacks
- New roles must be added to the appropriate dispatcher list in
roles/dispatch/defaults/main.yml - The entry must specify
role,var, andtagsat minimum
README.mdmust include: description, variable tables (with defaults, required flag, description, example), data structure documentation with both JSON and YAML examples, and a license linkmeta/argument_specs.ymlmust fully describe all role options with types and defaults
- Every feature or bugfix PR must include a changelog fragment in
changelogs/fragments/ - Fragment file must be valid YAML with
...document end marker - Use appropriate category:
minor_changes,major_changes,bugfixes,breaking_changes, etc.
- New roles should include test data in
roles/<role>/tests/configs/and atest.ymlplaybook - For controller roles, add corresponding test data to
tests/configs/controller/and include the role intests/configure_controller.yml
- YAML files must use
.ymlextension - YAML files must end with
...(document-end marker) - 2-space indentation, no trailing whitespace
- Jinja2 variables must have spaces:
{{ var }}not{{var}} - ansible-lint profile:
production - Python code:
blackformatting (line length 160),flake8compliance
When submitting PRs:
- Run
pre-commit run --all -c .pre-commit-config.yamlbefore pushing - Include a changelog fragment in
changelogs/fragments/ - Fill out the PR template completely (what, how to test, related issue)
- Ensure all CI checks pass (pre-commit workflow)
- Bug reports should reference the specific role and AAP version
- Feature requests for new roles should specify the target AAP module (
ansible.controller.*,ansible.platform.*,ansible.hub.*, oransible.eda.*) - Issues inactive for extended periods are automatically labeled and eventually closed by GitHub Actions