Ansible Inventory
Location: ansible/inventory.yml
Defines group-level variables for Ansible playbook execution. Host-specific data (IPs, ports) is sourced from ~/.config/auberge/hosts.toml and injected as a dynamic inventory at runtime.
Structure
Section titled “Structure”all: children: vps: vars: ansible_user: ansible ansible_ssh_private_key_file: "{{ ssh_identities_dir }}/ansible" admin_ssh_private_key_file: "{{ ssh_identities_dir }}/{{ admin_user_name }}" ansible_python_interpreter: /usr/bin/python3 ansible_ssh_pipelining: trueHow It Works
Section titled “How It Works”When running auberge ansible run, the CLI:
- Reads hosts.toml for the target host’s IP, port, and user
- Generates a temporary inventory YAML with the host entry
- Passes both inventories to Ansible:
-i inventory.yml -i <generated> - Ansible merges them: group vars from static file + host data from generated file
Group Variables
Section titled “Group Variables”ansible_user- SSH user after bootstrap (ansible)ssh_identities_dir- Host’s key directory,~/.ssh/identities/{{ inventory_hostname }}(defined ingroup_vars/all/main.yml)ansible_ssh_private_key_file- Path to SSH key (pattern-based per host)admin_ssh_private_key_file- Admin user’s SSH key pathansible_python_interpreter- Python 3 pathansible_ssh_pipelining- Enable SSH pipeliningansible_ssh_common_args- SSH connection tuning options
Adding a Host
Section titled “Adding a Host”Hosts are managed via hosts.toml, not the inventory file:
auberge host add my-host 203.0.113.10 --user root --port 22auberge ssh keygen --host my-host --user ansibleauberge ansible bootstrap my-host --ip 203.0.113.10Troubleshooting
Section titled “Troubleshooting”“Host not found”
auberge host listauberge host add my-host 203.0.113.10“SSH key not found”
auberge ssh keygen --host my-host --user ansibleRelated
Section titled “Related”- Hosts Configuration - hosts.toml management
- SSH Keys - SSH key configuration