atmos ansible
Use these subcommands to interact with Ansible for automating infrastructure configuration, application deployment, and orchestration.
Usage
For more details on Ansible commands and options, refer to the Ansible Documentation.
Path-Based Component Resolution
Atmos supports using filesystem paths instead of component names for convenience. This allows you to navigate to a component directory and use . to reference it:
This automatically resolves the path to the component name configured in your stack, eliminating the need to remember exact component names.
Supported path formats:
.- Current directory./component- Relative path from current directory../other-component- Relative path to sibling directory/absolute/path/to/component- Absolute path
Requirements:
- Must be inside a component directory under the configured base path
- Must specify
--stackflag - Component must exist in the specified stack configuration
- The component path must resolve to a unique component name - If multiple components in the stack reference the same component path, you must use the unique component name instead of the path
Atmos Flags
--stack(alias-s)Atmos stack.
--playbook(alias-p)(optional)Ansible playbook file to execute. Defaults to the playbook specified in
settings.ansible.playbookin the stack manifest.The command line flag takes precedence over the stack manifest setting.
--inventory(alias-i)(optional)Ansible inventory source. Can be a file path, directory, or dynamic inventory script.
Can also be specified via
settings.ansible.inventoryin the stack manifest. The command line flag takes precedence.--dry-run(optional)Perform a dry run without making actual changes. Displays the commands that would be executed.
Examples
Component Name Examples
Path-Based Examples
Passing Additional Ansible Options
Any flags after -- are passed directly to the underlying Ansible command:
Arguments
atmos-component(required for playbook)Atmos component name or filesystem path.
Supports both:- Component names:
webserver,database/postgres - Filesystem paths:
.(current directory),./webserver,components/ansible/webserver
When using paths, Atmos automatically resolves the path to the component name based on your stack configuration. See Path-Based Component Resolution above.
- Component names:
Stack Configuration
Configure Ansible components in your stack manifests:
components:
ansible:
webserver:
vars:
app_name: myapp
app_port: 8080
settings:
ansible:
playbook: site.yml
inventory: inventory/production
Variables defined in vars are passed to Ansible as extra variables via a generated YAML file.
Subcommands
📄️ playbook
Use this command to run an Ansible playbook for an Atmos component in a stack, applying configuration
📄️ version
Use this command to display the currently installed Ansible version and configuration information.