Run ssh-keyscan only when instance is created.
This commit is contained in:
parent
64c6a74de2
commit
ad30e5be01
1 changed files with 1 additions and 0 deletions
|
@ -100,6 +100,7 @@
|
|||
- name: get ssh keys from new host
|
||||
local_action: command ssh-keyscan {{ inventory_hostname }}
|
||||
register: hostkeys
|
||||
when: inventory_hostname not in result.list_vms
|
||||
|
||||
- name: add new ssh host key to known_hosts
|
||||
known_hosts:
|
||||
|
|
Loading…
Add table
Reference in a new issue