summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorBrian Coca <bcoca@users.noreply.github.com>2018-11-12 10:26:15 -0500
committerToshio Kuratomi <a.badger@gmail.com>2018-11-12 19:30:18 -0800
commit9389862d97b44f3b6a601390a61186d3519019f7 (patch)
treea4f310a6ccd33c4c97ca296e57663a52a70f53aa /docs
parentf4da73280c1201ad412f24c7b2e95f554533433f (diff)
downloadansible-9389862d97b44f3b6a601390a61186d3519019f7.tar.gz
added faq entry on ansible_host + delegation (#48438)
(cherry picked from commit 7ca6af396ed44e25ec8622c374e8f7d4f24f456b)
Diffstat (limited to 'docs')
-rw-r--r--docs/docsite/rst/reference_appendices/faq.rst13
1 files changed, 13 insertions, 0 deletions
diff --git a/docs/docsite/rst/reference_appendices/faq.rst b/docs/docsite/rst/reference_appendices/faq.rst
index 639bbc255e..31bf620fdd 100644
--- a/docs/docsite/rst/reference_appendices/faq.rst
+++ b/docs/docsite/rst/reference_appendices/faq.rst
@@ -596,6 +596,19 @@ Several reasons, in most cases it has to do with maintainability, there are tons
In other cases there are technical issues, for example, for python wheels, our dependencies are not present so there is little to no gain.
+.. _ansible_host_delegated:
+
+How do I get the original ansible_host when I delegate a task?
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+As the documentation states, connection variables are taken from the ``delegate_to`` host so ``ansible_host`` is overritten,
+but you can still access the orignal via ``hostvars``::
+
+ oringal_host: "{{ hostvars[inventory_hostname]['ansible_host'] }}"
+
+This works for all overriden connection variables, like ``ansible_user``, ``ansible_port``, etc.
+
+
.. _i_dont_see_my_question:
I don't see my question here