AnsiblePilot — Master Ansible Automation

AnsiblePilot is the leading resource for learning Ansible automation, DevOps, and infrastructure as code. Browse over 1,400 tutorials covering Ansible modules, playbooks, roles, collections, and real-world examples. Whether you are a beginner or an experienced engineer, our step-by-step guides help you automate Linux, Windows, cloud, containers, and network infrastructure.

Popular Topics

About Luca Berton

Luca Berton is an Ansible automation expert, author of 8 Ansible books published by Apress and Leanpub including "Ansible for VMware by Examples" and "Ansible for Kubernetes by Example", and creator of the Ansible Pilot YouTube channel. He shares practical automation knowledge through tutorials, books, and video courses to help IT professionals and DevOps engineers master infrastructure automation.

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.

Configuration as Code with ansible.platform Collection in AAP 2.6

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: AI-Assisted Inventory Generation in AAP 2.6 — Developer Preview

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

Authentication Setup

# group_vars/all.yml
aap_host: gateway.example.com
aap_username: admin
aap_password: "{{ vault_aap_password }}"
aap_verify_ssl: true

See also: How to Use the AAP 2.6 Automation Dashboard to Measure ROI

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

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

Workflows

- 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

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

See also: Key Metrics and KPIs to Track in the AAP 2.6 Automation Dashboard

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

Related Articles

publishing collections to Ansible Galaxythe Ansible template module referenceintegrating Ansible Vault with CIAnsible inventory best practicesAnsible loop patterns and tips

Category: installation

Browse all Ansible tutorials · AnsiblePilot Home