Configuration as Code with ansible.platform Collection in AAP 2.6
By Luca Berton · Published 2024-01-01 · Category: installation
How to manage your AAP 2.6 deployment as code using the new ansible.platform collection with unified RBAC and standardized variables.

Introduction
AAP 2.6 introduces improved platform management collections that enable true configuration-as-code for your entire automation platform. The ansible.platform collection centralizes management through the Gateway API with standardized variables.
See also: ansible.platform Collection: Configuration as Code for Ansible Automation Platform 2.7
Why Configuration as Code for AAP?
Managing your automation platform as code provides:
- Reproducibility — Rebuild environments from scratch
- Version control — Track all configuration changes in Git
- Consistency — Same configuration across dev, staging, production
- Automation — No manual clicks in the UI
- Audit trail — Complete history of who changed what
The ansible.platform Collection
Installation
ansible-galaxy collection install ansible.platformAuthentication Setup
# group_vars/all.yml
aap_host: gateway.example.com
aap_username: admin
aap_password: "{{ vault_aap_password }}"
aap_verify_ssl: trueManaging Resources as Code
Organizations
- name: Configure organizations
ansible.platform.organization:
name: "{{ item.name }}"
description: "{{ item.description }}"
state: present
loop:
- name: "IT Operations"
description: "Infrastructure and operations team"
- name: "Development"
description: "Application development team"Teams and RBAC
- name: Configure teams
ansible.platform.team:
name: "Network Automation"
organization: "IT Operations"
state: present
- name: Assign roles
ansible.platform.role:
user: "jsmith"
role: "Automation Operator"
organization: "IT Operations"
state: presentJob Templates
- name: Configure job templates
ansible.platform.job_template:
name: "Deploy Web Application"
organization: "Development"
project: "webapp-automation"
playbook: "deploy.yml"
inventory: "production"
credentials:
- "SSH Key"
- "Vault Credentials"
state: presentWorkflows
- name: Configure workflow
ansible.platform.workflow_job_template:
name: "Full Deployment Pipeline"
organization: "Development"
state: present
- name: Add workflow nodes
ansible.platform.workflow_job_template_node:
workflow: "Full Deployment Pipeline"
job_template: "Deploy Web Application"
success_nodes:
- "Run Tests"
state: presentSee also: AI-Assisted Inventory Generation in AAP 2.6 — Developer Preview
GitOps Workflow
Repository Structure
aap-config/
├── inventories/
│ └── aap_hosts.yml
├── group_vars/
│ └── all.yml
├── playbooks/
│ ├── configure-orgs.yml
│ ├── configure-teams.yml
│ ├── configure-templates.yml
│ └── configure-workflows.yml
├── requirements.yml
└── site.ymlCI/CD Integration
# .gitlab-ci.yml
deploy_aap_config:
stage: deploy
script:
- ansible-galaxy collection install -r requirements.yml
- ansible-playbook site.yml -i inventories/aap_hosts.yml
only:
- mainBest Practices
- Store secrets in Vault — Never commit passwords to Git
- Use idempotent playbooks — Run them repeatedly without side effects
- Environment-specific vars — Use group_vars for dev/staging/prod differences
- PR reviews — Require reviews for AAP configuration changes
- Gradual adoption — Start with a few resource types and expand
Conclusion
Configuration as code for AAP 2.6 brings the same discipline and auditability to your automation platform that you apply to your infrastructure. The unified ansible.platform collection makes this easier than ever.
For more Ansible tutorials and guides, explore the complete article collection on Ansible Pilot.
See also: How to Use the AAP 2.6 Automation Dashboard to Measure ROI
Related Articles
Category: installation