aws_cloud: drop additional (-temp) known hosts entries
This commit is contained in:
parent
2f32aeec00
commit
c28c90504b
2 changed files with 16 additions and 1 deletions
|
@ -18,6 +18,18 @@
|
|||
- /root/.ssh/known_hosts
|
||||
when: birthday is defined
|
||||
|
||||
- name: birthday=on - drop other known host entries
|
||||
local_action: known_hosts path={{ item.0 }}
|
||||
host={{ item.1 }}
|
||||
state=absent
|
||||
with_nested:
|
||||
- [/root/.ssh/known_hosts]
|
||||
- "{{ additional_known_hosts_cleanup[inventory_hostname] }}"
|
||||
|
||||
when:
|
||||
- additional_known_hosts_cleanup is defined
|
||||
- additional_known_hosts_cleanup[inventory_hostname] is defined
|
||||
|
||||
- name: gather the temporary ssh host key from the new instance
|
||||
local_action: command ssh-keyscan -t {{ item }} {{ inventory_hostname }}
|
||||
register: hostkey
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue