Bookmark this page

Summary

  • Ansible variables help you reuse values across files in an entire Ansible project.

  • You can define variables for hosts and host groups in the inventory file.

  • You can define variables for plays and tasks in the playbook or in external files.

  • Extra variables are defined on the command line and take precedence over all other variables.

  • You can use the register keyword to capture the output of a command in a variable.

  • Ansible Vault provides one way to protect sensitive data, such as password hashes and private keys that are used by your Ansible Playbooks.

  • Ansible facts are variables that Ansible automatically discovers from a managed host.

Revision: rh294-9.0-c95c7de