Ansible variable

A named value, such as http_port or site_name, that tasks and templates refer to instead of writing the value in directly.

In more detail

Variables can come from the inventory, group_vars and host_vars files, a play's vars section, role defaults, facts, registered results and the command line. They are inserted with Jinja, as in {{ http_port }}. Keeping values in variables lets one playbook serve every environment, because only the data changes.

Related terms

Taught in

References

Certification courses