From c2c20baf01018d17bfeef866e11c4c2b56fad60c Mon Sep 17 00:00:00 2001 From: Michael Scherer Date: Sat, 25 Jul 2015 14:20:07 +0200 Subject: [PATCH] Add more explicit documentation on ansible_nodename and ansible_hostname Fix #9971, based on text from Paul Czarkowski --- docsite/rst/playbooks_variables.rst | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/docsite/rst/playbooks_variables.rst b/docsite/rst/playbooks_variables.rst index fdea87f288..619a3cf07b 100644 --- a/docsite/rst/playbooks_variables.rst +++ b/docsite/rst/playbooks_variables.rst @@ -308,7 +308,7 @@ This will return a ginormous amount of variable data, which may look like this, "type": "ether" }, "ansible_form_factor": "Other", - "ansible_fqdn": "ubuntu2", + "ansible_fqdn": "ubuntu2.example.com", "ansible_hostname": "ubuntu2", "ansible_interfaces": [ "lo", @@ -353,6 +353,7 @@ This will return a ginormous amount of variable data, which may look like this, "size_total": 20079898624 } ], + "ansible_nodename": "ubuntu2.example.com", "ansible_os_family": "Debian", "ansible_pkg_mgr": "apt", "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:: - {{ 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.