From d681c3b0bd3373400dd629f9d72f99e5d0cde7d2 Mon Sep 17 00:00:00 2001 From: Sloane Hertel Date: Mon, 16 Sep 2019 14:00:29 -0400 Subject: [PATCH] Add implicit localhost hostvars note (#61956) (cherry picked from commit b1afb37ac92645c7a2017047fa21f4ce1e2020d8) --- docs/docsite/rst/inventory/implicit_localhost.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/docsite/rst/inventory/implicit_localhost.rst b/docs/docsite/rst/inventory/implicit_localhost.rst index 43bf598f091..2f065dc7b3b 100644 --- a/docs/docsite/rst/inventory/implicit_localhost.rst +++ b/docs/docsite/rst/inventory/implicit_localhost.rst @@ -28,6 +28,7 @@ You can override the built-in implicit version by creating a ``localhost`` host .. note:: - This host is not targetable via any group, however it will use vars from ``host_vars`` and from the 'all' group. + - Implicit localhost does not appear in the ``hostvars`` magic variable unless demanded, such as by ``"{{ hostvars['localhost'] }}"``. - The ``inventory_file`` and ``inventory_dir`` magic variables are not available for the implicit localhost as they are dependent on **each inventory host**. - This implicit host also gets triggered by using ``127.0.0.1`` or ``::1`` as they are the IPv4 and IPv6 representations of 'localhost'. - Even though there are many ways to create it, there will only ever be ONE implicit localhost, using the name first used to create it.