Add host ssh keys to known hosts
When creating the inventory file, perform an ssh keyscan on each host and add it to the known_hosts file for the job. Change-Id: If4b362edf9a1ef280e1a8261b91a73ba92932d18
This commit is contained in:
parent
14e0bb2ec5
commit
6c0978c2d1
|
@ -770,6 +770,11 @@ class AnsibleJob(object):
|
|||
for k, v in host_vars.items():
|
||||
inventory.write('%s=%s' % (k, v))
|
||||
inventory.write('\n')
|
||||
if 'ansible_host' in host_vars:
|
||||
os.system("ssh-keyscan %s >> %s" % (
|
||||
host_vars['ansible_host'],
|
||||
self.jobdir.known_hosts))
|
||||
|
||||
with open(self.jobdir.vars, 'w') as vars_yaml:
|
||||
zuul_vars = dict(zuul=args['zuul'])
|
||||
vars_yaml.write(
|
||||
|
|
Loading…
Reference in New Issue