Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added faq entry on ansible_host + delegation #48438

Merged
merged 1 commit into from
Nov 12, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 13 additions & 0 deletions docs/docsite/rst/reference_appendices/faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down