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

Add an ansible_ssh_host inventory variable #1072

Merged
merged 1 commit into from
Sep 23, 2012
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
7 changes: 5 additions & 2 deletions lib/ansible/runner/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,10 +343,13 @@ def is_set(var):
actual_host = host
try:
delegate_to = inject.get('delegate_to', None)
alternative_host = inject.get('ansible_ssh_host', None)
if delegate_to is not None:
actual_host = delegate_to
actual_host = delegate_to
elif alternative_host is not None:
actual_host = alternative_host
conn = self.connector.connect(actual_host, port)
if delegate_to is not None:
if delegate_to is not None or alternative_host is not None:
conn._delegate_for = host
except errors.AnsibleConnectionFailed, e:
result = dict(failed=True, msg="FAILED: %s" % str(e))
Expand Down