mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Merge pull request #11736 from mscherer/fix_9971
Add more explicit documentation on ansible_nodename and ansible_hostname
This commit is contained in:
commit
6c1f4ddf7e
1 changed files with 6 additions and 2 deletions
|
@ -308,7 +308,7 @@ This will return a ginormous amount of variable data, which may look like this,
|
||||||
"type": "ether"
|
"type": "ether"
|
||||||
},
|
},
|
||||||
"ansible_form_factor": "Other",
|
"ansible_form_factor": "Other",
|
||||||
"ansible_fqdn": "ubuntu2",
|
"ansible_fqdn": "ubuntu2.example.com",
|
||||||
"ansible_hostname": "ubuntu2",
|
"ansible_hostname": "ubuntu2",
|
||||||
"ansible_interfaces": [
|
"ansible_interfaces": [
|
||||||
"lo",
|
"lo",
|
||||||
|
@ -353,6 +353,7 @@ This will return a ginormous amount of variable data, which may look like this,
|
||||||
"size_total": 20079898624
|
"size_total": 20079898624
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"ansible_nodename": "ubuntu2.example.com",
|
||||||
"ansible_os_family": "Debian",
|
"ansible_os_family": "Debian",
|
||||||
"ansible_pkg_mgr": "apt",
|
"ansible_pkg_mgr": "apt",
|
||||||
"ansible_processor": [
|
"ansible_processor": [
|
||||||
|
@ -387,8 +388,11 @@ In the above the model of the first harddrive may be referenced in a template or
|
||||||
|
|
||||||
Similarly, the hostname as the system reports it is::
|
Similarly, the hostname as the system reports it is::
|
||||||
|
|
||||||
{{ ansible_hostname }}
|
{{ ansible_nodename }}
|
||||||
|
|
||||||
|
and the unqualified hostname shows the string before the first period(.)::
|
||||||
|
|
||||||
|
{{ ansible_hostname }}
|
||||||
|
|
||||||
Facts are frequently used in conditionals (see :doc:`playbooks_conditionals`) and also in templates.
|
Facts are frequently used in conditionals (see :doc:`playbooks_conditionals`) and also in templates.
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue