atmos
atmos copied to clipboard
Add Native Ansible Support
what
- Add native Ansible component support (
ansible) across config, schema, stack processing, and exec. - Introduce
atmos ansiblewith Terraform-style wiring and rich help:-
run: executeansible-playbookwith component-scoped vars -
inventory: runansible-inventory(defaults to--list) -
galaxy: runansible-galaxy(defaults toinstall -r requirements.ymlif no args) -
doc: runansible-doc -
config: runansible-config -
vault: runansible-vault -
version: showansible-playbook --version
-
- Extend stack processing to merge
components.ansibleandsettings.ansible:-
settings.ansible.playbookandsettings.ansible.inventory -
components.ansible.commandoverride and base path resolution
-
- Add config flags/env + path utilities:
- Flags:
--ansible-command,--ansible-dir - Env:
ATMOS_COMPONENTS_ANSIBLE_COMMAND,ATMOS_COMPONENTS_ANSIBLE_BASE_PATH - Working dir/varfile helpers for Ansible (
<context>-<component>.ansible.vars.yaml)
- Flags:
- CLI structure matches Terraform:
- Centralized
getAnsibleCommandsincmd/ansible_commands.gowith detailed Long help and examples -
ansibleRunmirrorsterraformRunsemantics, including--passthrough and Atmos flag stripping
- Centralized
Examples:
# Run playbook with vars from stack/component
atmos ansible run web -s tenant/ue2/dev -- --check
# Inventory (defaults to --list)
atmos ansible inventory web -s tenant/ue2/dev
# Galaxy (defaults to install -r requirements.yml)
atmos ansible galaxy web -s tenant/ue2/dev
# Vault/doc/config passthrough
atmos ansible vault web -s tenant/ue2/dev -- view group_vars/all/vault.yml
atmos ansible doc web -s tenant/ue2/dev -- -l
atmos ansible config web -s tenant/ue2/dev -- dump
why
- Parity with Terraform/Helmfile UX so teams can standardize IaC + config mgmt under Atmos.
- Leverage Atmos deep-merge, settings, and ENV handling for repeatable Ansible runs.
- Reduce boilerplate for varfiles/inventory, enforce consistent working dirs, and improve debuggability via structured logging.
- Prepare for CI/CD and future hooks/pro integrations with consistent command surfaces and flag handling.
todos
- [ ] documentation, website overview/subcommands, schema for
settings.ansible/components.ansible, CLI markdown help, completions, etc - [ ] testing, e2e dry-run tests, ensure
list componentsshows ansible - [ ] release/CHANGELOG entry
references
- PR context and prior art for Ansible integration inspiration:
- https://github.com/cloudposse/atmos/pull/1448
- https://github.com/cloudposse/atmos/pull/1394
I use atmos in my homelab to run terraform and packer and thought it would be nice to handle ansible as well. Ideally we'd take the best parts of this and @RoseSecurity's work in https://github.com/cloudposse/atmos/pull/1448 to get this done.
- [ ] Add docs
💥 This pull request now has conflicts. Could you fix it @Adrastopoulos? 🙏