Chapter 16. Ansible variables
The following variables control how Ansible Automation Platform interacts with remote hosts.
Additional information on variables specific to certain plugins can be found at https://docs.ansible.com/ansible-core/devel/collections/ansible/builtin/index.html
A list of global configuration options can be found at https://docs.ansible.com/ansible-core/devel/reference_appendices/config.html
Variable | Description |
---|---|
| The connection plugin used for the task on the target host.
This can be the name of any of ansible connection plugin. SSH protocol types are
Default = |
|
The ip or name of the target host to use instead of |
| The connection port number, if not, the default (22 for ssh). |
| The user name to use when connecting to the host. |
| The password to use to authenticate to the host. Never store this variable in plain text. Always use a vault. |
| Private key file used by ssh. Useful if using multiple keys and you do not want to use an SSH agent. |
|
This setting is always appended to the default command line for |
|
This setting is always appended to the default |
|
This setting is always appended to the default |
|
This setting is always appended to the default |
|
Determines if SSH pipelining is used. This can override the pipelining setting in |
| |
| This variable sets the SSH user for the installer to use and defaults to root. This user must allow SSH-based authentication without requiring a password. If using SSH key-based authentication, then the key must be managed by an SSH agent. |
| (added in version 2.2)
This setting overrides the default behavior to use the system ssh. This can override the ssh_executable setting in |
|
The shell type of the target system. You should not use this setting unless you have set the |
|
This sets the shell that the ansible controller uses on the target machine, and overrides the executable in
You should only change if it is not possible to use |
The following variables cannot be set directly by the user. Ansible will always override them to reflect internal state.
Variable | Description |
---|---|
| Boolean that indicates if we are in check mode or not |
| The names of the roles currently imported into the current play as dependencies of other plays |
|
Contents of the |
|
A dictionary or map containing extended loop information when enabled using |
| The name of the value provided to loop_control.loop_var. Added in 2.8 |
|
The name of the value provided to |
|
When the current role is being executed by means of an
For example: When role A includes role B, inside role B, |
|
When the current role is being executed by means of an |
|
List of active hosts in the current play run limited by the serial, aka |
| List of hosts in the current play run, not limited by the serial. Failed or unreachable hosts are excluded from this list. |
| List of all the hosts that were targeted by the play |
| The names of the roles currently imported into the current play. This list does not contain the role names that are implicitly included through dependencies. |
| The name of the currently executed play. Added in 2.8. (name attribute of the play, not file name of the playbook.) |
| Current search path for action plugins and lookups, in other words, where we search for relative paths when you do template: src=myfile |
|
Dictionary or map that contains information about the current running version of ansible, it has the following keys: |