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.

Standardized Environment Variables in AAP 2.6 — Migration Guide

By Luca Berton · Published 2024-01-01 · Category: troubleshooting

AAP 2.6 standardizes environment variables from component-specific names to unified AAP_ prefix. Learn what changed and how to update your configurations.

Standardized Environment Variables in AAP 2.6 — Migration Guide

Introduction

AAP 2.6 introduces a significant quality-of-life improvement: standardized environment variable naming across all platform components. Collections now use a unified AAP_ prefix instead of component-specific prefixes.

See also: AAP 2.6 RPM Deprecation — Planning Your Containerized Migration

What Changed

Before AAP 2.6

Each component had its own variable naming convention:

# Automation Controller
CONTROLLER_HOST=controller.example.com
CONTROLLER_USERNAME=admin
CONTROLLER_PASSWORD=secret
CONTROLLER_VERIFY_SSL=true

# Automation Hub AH_HOST=hub.example.com AH_USERNAME=admin AH_TOKEN=my-token

# Event-Driven Ansible EDA_HOST=eda.example.com EDA_USERNAME=admin

After AAP 2.6

A single, unified naming convention:

# All components use AAP_ prefix
AAP_HOST=gateway.example.com
AAP_USERNAME=admin
AAP_PASSWORD=secret
AAP_VERIFY_SSL=true

Module Variable Changes

Collections also standardize module-level variables:

# Before (component-specific)
- name: Create job template
  ansible.controller.job_template:
    controller_host: "{{ controller_host }}"
    controller_username: "{{ controller_user }}"
    name: "Deploy App"

# After (unified) - name: Create job template ansible.platform.job_template: aap_host: "{{ aap_host }}" aap_username: "{{ aap_user }}" name: "Deploy App"

See also: How to Upgrade from AAP 2.4 to AAP 2.6 — Step-by-Step Guide

Migration Steps

Step 1: Identify Current Variables

Search your playbooks and environment for component-specific variables:

grep -r "CONTROLLER_\|AH_\|EDA_" /path/to/playbooks/
grep -r "controller_host\|ah_host\|eda_host" /path/to/playbooks/

Step 2: Update Environment Variables

Update your CI/CD pipelines, environment files, and vault entries:

# Update .env files
sed -i 's/CONTROLLER_HOST/AAP_HOST/g' .env
sed -i 's/CONTROLLER_USERNAME/AAP_USERNAME/g' .env
sed -i 's/CONTROLLER_PASSWORD/AAP_PASSWORD/g' .env

Step 3: Update Playbooks

Replace component-specific module calls with the ansible.platform collection.

Step 4: Test

Verify all automation works with the new variable names before deploying to production.

Backward Compatibility

The old variable names may still work in AAP 2.6 for backward compatibility, but they are deprecated and will be removed in a future release. Migrate now to avoid issues later.

See also: AI-Assisted Inventory Generation in AAP 2.6 — Developer Preview

Conclusion

Standardized environment variables simplify configuration management and reduce confusion when working across platform components. Update your configurations now to benefit from the unified naming convention.

For more Ansible tutorials and guides, explore the complete article collection on Ansible Pilot.

Related Articles

Ansible Vault best practicesJinja2 templating in Ansiblesetting environment variables in Ansible

Category: troubleshooting

Browse all Ansible tutorials · AnsiblePilot Home