Skip to content

Commit

Permalink
Fixes 5870 Template delegate hostname earlier in the process
Browse files Browse the repository at this point in the history
  • Loading branch information
jctanner committed Feb 4, 2014
1 parent e0429a4 commit 5fafc61
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions lib/ansible/runner/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,10 @@ def _compute_delegate(self, host, password, remote_inject):

delegate = {}

delegate['host'] = host
# allow ansible_ssh_host to be templated
delegate['host'] = template.template(self.basedir, host,
remote_inject, fail_on_undefined=True)

delegate['inject'] = remote_inject.copy()

# set any interpreters
Expand All @@ -324,10 +327,6 @@ def _compute_delegate(self, host, password, remote_inject):
# get the real ssh_address for the delegate
delegate['ssh_host'] = this_info.get('ansible_ssh_host', delegate['host'])

# allow ansible_ssh_host to be templated
delegate['host'] = template.template(self.basedir, this_host,
delegate['inject'], fail_on_undefined=True)

delegate['port'] = this_info.get('ansible_ssh_port', port)
delegate['user'] = self._compute_delegate_user(this_host, delegate['inject'])
delegate['pass'] = this_info.get('ansible_ssh_pass', password)
Expand Down

0 comments on commit 5fafc61

Please sign in to comment.