Ansible Components
Ansible components run Ansible playbooks for configuration management and infrastructure automation. They allow you to manage playbook execution with the same stack-based configuration approach used for Terraform, Helmfile, and Packer.
Available Configuration Sections
Ansible components support the common configuration sections:
vars- Variables passed to ansible via
--extra-vars. env- Environment variables during execution.
settingsIntegrations, metadata, and Ansible-specific settings like playbook and inventory.
metadata- Component behavior and inheritance.
command- Override ansible binary.
hooks- Lifecycle event handlers.
Component Structure
A typical Ansible component configuration:
components:
ansible:
webserver:
vars:
app_name: myapp
app_port: 8080
app_version: "1.0.0"
env:
ANSIBLE_HOST_KEY_CHECKING: "false"
settings:
ansible:
playbook: site.yml
inventory: inventory/production
Ansible Directory Structure
Ansible components are located in the path configured in atmos.yaml:
# atmos.yaml
components:
ansible:
base_path: components/ansible
Example structure:
components/ansible/
├── hello-world/
│ ├── site.yml