Fixing some delegate_to bugs

* Moving connection creation until after the task is post_validated,
  to make sure all fields are properly templated (#11230)
* Fixing problems related to the connection method and remote address
  lookup on the delegated-to host

Fixes #11230
This commit is contained in:
James Cammarata 2015-07-09 08:23:43 -04:00
commit a9712bb0fb
2 changed files with 8 additions and 7 deletions

View file

@ -123,6 +123,7 @@ class Host:
results = combine_vars(results, self.vars)
results['inventory_hostname'] = self.name
results['inventory_hostname_short'] = self.name.split('.')[0]
results['ansible_ssh_host'] = self.ipv4_address
results['group_names'] = sorted([ g.name for g in groups if g.name != 'all'])
return results