You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It also illustrates the usage of host facts in an example: {{ ansible_facts['devices']['xvda']['model'] }}
Notably, the dictionary key omits the ansible_ prefix, even though the prefix shows up in the setup module output.
Please add a clarification on the page to emphasise that the lack of ansible_ prefix is working as implemented, and that users should avoid repeating the ansible_ prefix in template.
The text was updated successfully, but these errors were encountered:
Thanks for your Ansible docs contribution! We talk about Ansible documentation on matrix at #docs:ansible.im and on libera IRC at #ansible-docs if you ever want to join us and chat about the docs! We meet there on Tuesdays (see the Ansible calendar) and welcome additions to our weekly agenda items - scroll down to find the upcoming agenda and add a comment to put something new on that agenda.
Documentation fix:
Add a sentence to say when you pull that data, drop the ansible_ prefix. For example we use {{ ansible_facts['devices']['xvda']['model'] }} instead of {{ ansible_facts['ansible_devices']['xvda']['model'] }}
The "Discovering variables" page suggests to use
setup
module to spell out all host facts:It also illustrates the usage of host facts in an example:
{{ ansible_facts['devices']['xvda']['model'] }}
Notably, the dictionary key omits the
ansible_
prefix, even though the prefix shows up in the setup module output.Please add a clarification on the page to emphasise that the lack of
ansible_
prefix is working as implemented, and that users should avoid repeating theansible_
prefix in template.The text was updated successfully, but these errors were encountered: