What do the settings inventory, remote_user, ask_pass, become, become_method, become_user and become_ask_pass control, and what are their defaults?
Three connection settings (where the hosts are, who to log in as, whether to prompt for the SSH password) and four privilege-escalation settings (whether to switch user, how, to whom, and whether to prompt for that password).
| Setting | Section | Controls | Default |
|---|---|---|---|
inventory |
[defaults] |
Path to the inventory file(s) or script | (system path) |
remote_user |
[defaults] |
User Ansible logs in as on the managed host | root (when run through ansible-navigator) |
ask_pass |
[defaults] |
Prompt for an SSH password | false |
become |
[privilege_escalation] |
Switch to another user after connecting | false |
become_method |
[privilege_escalation] |
How to switch (sudo, su, ...) | sudo |
become_user |
[privilege_escalation] |
Which user to switch to | root |
become_ask_pass |
[privilege_escalation] |
Prompt for the sudo/su password | false |
The split mirrors how a human admin works: first log in over SSH as some account (remote_user, ask_pass), then, if a task needs it, run commands as root with sudo (become_*). The defaults assume key-based SSH and passwordless sudo, which is what makes unattended runs possible.
On remote_user: when no user is set, plain ansible uses the name of the user running it on the control node. ansible-navigator runs Ansible inside a container where that local user is root, so there the effective default is root.
Go deeper:
Ansible Configuration Settings (official docs) —
DEFAULT_REMOTE_USER,DEFAULT_BECOME_METHODand the others, with their defaults.Connection methods and details (official docs) — how the remote user and SSH keys are chosen.