From 5333e4138cb34829d24827bf8392effeee1be619 Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Mon, 17 May 2021 14:24:26 -0400 Subject: [PATCH] note about adhoc delegate_to hosts (#74687) * Update docs/docsite/rst/user_guide/playbooks_delegation.rst --- docs/docsite/rst/user_guide/playbooks_delegation.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/docsite/rst/user_guide/playbooks_delegation.rst b/docs/docsite/rst/user_guide/playbooks_delegation.rst index 1042bafb455..75a950c2c74 100644 --- a/docs/docsite/rst/user_guide/playbooks_delegation.rst +++ b/docs/docsite/rst/user_guide/playbooks_delegation.rst @@ -77,7 +77,9 @@ To specify more arguments, use the following syntax:: body: "{{ mail_body }}" run_once: True -The `ansible_host` variable reflects the host a task is delegated to. +.. warning:: + + Although you can ``delegate_to`` a host that does not exist in inventory (by adding IP address, DNS name or whatever requirement the connection plugin has), doing so does not add the host to your inventory and might cause issues. Hosts delegated to in this way do not inherit variables from the "all" group', so variables like connection user and key are missing. If you must ``delegate_to`` a non-inventory host, use the :ref:`add host module `. .. _delegate_facts: