Difference between revisions of "Ansible variables"
Jump to navigation
Jump to search
↑ https://docs.ansible.com/ansible/latest/user_guide/playbooks_variables.html#referencing-simple-variables
↑ https://docs.ansible.com/ansible/latest/user_guide/intro_inventory.html#organizing-host-and-group-variables
Line 5: | Line 5: | ||
your_new_variable: your_new_var_value | your_new_variable: your_new_var_value | ||
− | Using variables, just reference it using {{ }}: <ref>https://docs.ansible.com/ansible/latest/user_guide/playbooks_variables.html#referencing-simple-variables</ref> | + | Using variables, just reference it using <nowiki><code>{{ }}</code></nowiki>: <ref>https://docs.ansible.com/ansible/latest/user_guide/playbooks_variables.html#referencing-simple-variables</ref> |
− | {{ your_new_var_value }} | + | <nowiki>{{ your_new_var_value }}</nowiki> |
Revision as of 12:46, 12 October 2022
Creating a variable:
vars: your_new_variable: your_new_var_value
Using variables, just reference it using <code>{{ }}</code>: [1]
{{ your_new_var_value }}
- name: Execute a command ansible.builtin.command: "false" debugger: on_failed
Related
vars:
- Ansible print and debug examples
- Msg: The task includes an option with an undefined variable.
- DEBUG
--extra-vars
lookup
See also
Advertising: