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.

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

``bash

ansible-galaxy collection install ansible.platform

`

Authentication Setup

`yaml

group_vars/all.yml

aap_host: gateway.example.com

aap_username: admin

aap_password: "{{ vault_aap_password }}"

aap_verify_ssl: true

`

Managing Resources as Code

Organizations

`yaml

  • 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

`yaml

  • 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: present

`

Job Templates

`yaml

  • 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: present

`

Workflows

`yaml

  • 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: present

`

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.yml

`

CI/CD Integration

`yaml

.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:

- main

``

Best Practices

1. Store secrets in Vault — Never commit passwords to