connection variables
Inventory variables with reserved names, such as ansible_user, ansible_port and ansible_connection, that tell Ansible how to reach and log in to a host.
In more detail
They are ordinary variables, so they can be set on a host, a group or everything, and follow the same precedence rules. ansible_user is the account you connect as, which is different from the account you become. A per-host override sits on the host's own line in an INI inventory.
Example
[webservers:vars]
ansible_user=deployRelated terms
- connection plugin — The plugin that decides how Ansible reaches a host: SSH by default, or local, WinRM, a container runtime or a network device protocol.
- SSH key — A key pair used to log in over SSH: the private key stays on your machine and the public key is added to the server account.
- become — The Ansible keyword that switches on privilege escalation, so a task or a whole play runs as another account, root by default.
- variable precedence — The fixed order Ansible uses to decide which value wins when the same variable is set in several places.
Taught in
- Ansible Architecture And The Control Node — Ansible Configuration Management at Scale
- The Static Inventory File — Ansible Configuration Management at Scale
- Host Groups And Host Variables — Ansible Configuration Management at Scale
- Dynamic Inventory — Ansible Configuration Management at Scale
- Connections And Privilege Escalation — Ansible Configuration Management at Scale
- Inventory Variables: Ranges, group_vars And host_vars — RHCE in Ansible (EX294): Automate Red Hat Systems