Add host IP address to host_keys

We need to prefix our node IP address to the host_keys we get from
nodepool. Otherwise, ansible will fail to properly SSH to the node.

Change-Id: I400e2fdde507b742d133dc2b851a5d12686eb551
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
This commit is contained in:
Paul Belanger 2017-04-05 12:44:32 -04:00
parent b84ad2278c
commit fb150d95ae
1 changed files with 6 additions and 1 deletions

View File

@ -646,10 +646,15 @@ class AnsibleJob(object):
nodepool_az=node.get('az'),
nodepool_provider=node.get('provider'),
nodepool_region=node.get('region'))
host_keys = []
for key in node.get('host_keys'):
host_keys.append("%s %s" % (ip, key))
hosts.append(dict(
name=node['name'],
host_vars=host_vars,
host_keys=node.get('host_keys')))
host_keys=host_keys))
return hosts
def _blockPluginDirs(self, path):