Skip to content

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.

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: true

When running auberge ansible run, the CLI:

  1. Reads hosts.toml for the target host’s IP, port, and user
  2. Generates a temporary inventory YAML with the host entry
  3. Passes both inventories to Ansible: -i inventory.yml -i <generated>
  4. Ansible merges them: group vars from static file + host data from generated file
  • ansible_user - SSH user after bootstrap (ansible)
  • ssh_identities_dir - Host’s key directory, ~/.ssh/identities/{{ inventory_hostname }} (defined in group_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 path
  • ansible_python_interpreter - Python 3 path
  • ansible_ssh_pipelining - Enable SSH pipelining
  • ansible_ssh_common_args - SSH connection tuning options

Hosts are managed via hosts.toml, not the inventory file:

Terminal window
auberge host add my-host 203.0.113.10 --user root --port 22
auberge ssh keygen --host my-host --user ansible
auberge ansible bootstrap my-host --ip 203.0.113.10

“Host not found”

Terminal window
auberge host list
auberge host add my-host 203.0.113.10

“SSH key not found”

Terminal window
auberge ssh keygen --host my-host --user ansible