Skip to content

Commit 941bd97

Browse files
First pass at adding notes requested in #1638 (#2566) (#2598)
(cherry picked from commit 44af1e5) Co-authored-by: Lyle McKarns <[email protected]>
1 parent ce6bf70 commit 941bd97

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

docs/docsite/rst/playbook_guide/playbooks_vars_facts.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -499,6 +499,8 @@ To reference the system hostname:
499499
500500
{{ ansible_facts['nodename'] }}
501501
502+
Note that `ansible_` prefix shown in the setup module output is not used when addressing these variables.
503+
502504
You can use facts in conditionals (see :ref:`playbooks_conditionals`) and also in templates. You can also use facts to create dynamic groups of hosts that match particular criteria, see the :ref:`group_by module <group_by_module>` documentation for details.
503505

504506
.. note:: Because ``ansible_date_time`` is created and cached when Ansible gathers facts before each playbook run, it can get stale with long-running playbooks. If your playbook takes a long time to run, use the ``pipe`` filter (for example, ``lookup('pipe', 'date +%Y-%m-%d.%H:%M:%S')``) or :ref:`now() <templating_now>` with a Jinja 2 template instead of ``ansible_date_time``.

0 commit comments

Comments
 (0)