Skip to content

Add Native Ansible Support - #1573

Closed
Gabriel Hall (Adrastopoulos) wants to merge 5 commits into
cloudposse:mainfrom
Adrastopoulos:adrastopoulos/add-ansible-support
Closed

Gabriel Hall (Adrastopoulos) wants to merge 5 commits into
cloudposse:mainfrom
Adrastopoulos:adrastopoulos/add-ansible-support

Conversation

@Adrastopoulos

@Adrastopoulos Gabriel Hall (Adrastopoulos) commented Oct 1, 2025 •

Copy link
Copy Markdown
Contributor

what

  • Add native Ansible component support (ansible) across config, schema, stack processing, and exec.
  • Introduce atmos ansible with Terraform-style wiring and rich help:
    • run: execute ansible-playbook with component-scoped vars
    • inventory: run ansible-inventory (defaults to --list)
    • galaxy: run ansible-galaxy (defaults to install -r requirements.yml if no args)
    • doc: run ansible-doc
    • config: run ansible-config
    • vault: run ansible-vault
    • version: show ansible-playbook --version
  • Extend stack processing to merge components.ansible and settings.ansible:
    • settings.ansible.playbook and settings.ansible.inventory
    • components.ansible.command override 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)
  • CLI structure matches Terraform:
    • Centralized getAnsibleCommands in cmd/ansible_commands.go with detailed Long help and examples
    • ansibleRun mirrors terraformRun semantics, including -- passthrough and Atmos flag stripping

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 components shows ansible
  • release/CHANGELOG entry

references

@Adrastopoulos Gabriel Hall (Adrastopoulos) changed the title feat: initialize ansible support Add Native Ansible Support Oct 1, 2025
@mergify mergify Bot added the triage Needs triage label Oct 1, 2025
@Adrastopoulos

Copy link
Copy Markdown
Contributor Author

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 #1448 to get this done.

@osterman

Copy link
Copy Markdown
Member
  • Add docs

@osterman Erik Osterman (Cloud Posse) (osterman) added the no-release Do not create a new release (wait for additional code changes) label Oct 1, 2025

@github-advanced-security github-advanced-security AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

golangci-lint found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

@mergify

mergify Bot commented Oct 8, 2025

Copy link
Copy Markdown
Contributor

馃挜 This pull request now has conflicts. Could you fix it Gabriel Hall (@Adrastopoulos)? 馃檹

@mergify mergify Bot added the conflict This PR has conflicts label Oct 8, 2025
@mergify mergify Bot removed the conflict This PR has conflicts label Dec 30, 2025
@mergify

mergify Bot commented Dec 30, 2025

Copy link
Copy Markdown
Contributor

馃挜 This pull request now has conflicts. Could you fix it Gabriel Hall (@Adrastopoulos)? 馃檹

@mergify mergify Bot added the conflict This PR has conflicts label Dec 30, 2025
@osterman

Erik Osterman (Cloud Posse) (osterman) commented Feb 27, 2026 •

Copy link
Copy Markdown
Member

Superseded by #2042

@mergify mergify Bot removed conflict This PR has conflicts triage Needs triage labels Feb 27, 2026
@Adrastopoulos
Gabriel Hall (Adrastopoulos) deleted the adrastopoulos/add-ansible-support branch September 3, 2026 05:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-release Do not create a new release (wait for additional code changes)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants