tasks/aws_cloud.yml: hack with known_hosts removal
We observed a situation when two keys were specified in known_hosts, and only one was removed by the playbook. At least we think this is what is actually happening.
This commit is contained in:
parent
0270957497
commit
1efa0220c3
1 changed files with 5 additions and 1 deletions
|
@ -14,12 +14,16 @@
|
|||
local_action: known_hosts path={{item}}
|
||||
host={{ inventory_hostname }}
|
||||
state=absent
|
||||
# HACK! We repeat this task 3 times. We assume that "known_hosts" module is
|
||||
# broken, and it removes only the first host key available (not all of them).
|
||||
with_items:
|
||||
- /root/.ssh/known_hosts
|
||||
- /root/.ssh/known_hosts
|
||||
- /root/.ssh/known_hosts
|
||||
when: birthday is defined
|
||||
|
||||
- name: gather the temporary ssh host key from the new instance
|
||||
local_action: command ssh-keyscan -t ssh-ed25519 {{ inventory_hostname }}
|
||||
local_action: command ssh-keyscan -t rsa {{ inventory_hostname }}
|
||||
register: hostkey
|
||||
when: birthday is defined
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue