aws_cloud: try to load and hack-around all host keys
This commit is contained in:
parent
ad935bba81
commit
0ed8f5f405
1 changed files with 8 additions and 3 deletions
|
@ -21,13 +21,18 @@
|
|||
- name: gather the temporary ssh host key from the new instance
|
||||
local_action: command ssh-keyscan -t rsa {{ inventory_hostname }}
|
||||
register: hostkey
|
||||
loop:
|
||||
- rsa
|
||||
- ecdsa
|
||||
- ed25519
|
||||
when: birthday is defined
|
||||
|
||||
- name: add new ssh host key (until we can sign it)
|
||||
local_action: known_hosts path={{item}} key="{{ hostkey.stdout }}"
|
||||
local_action: known_hosts path={{item.0}} key="{{ item.1.stdout }}"
|
||||
host={{ inventory_hostname }} state=present
|
||||
with_items:
|
||||
- /root/.ssh/known_hosts
|
||||
with_nested:
|
||||
- [/root/.ssh/known_hosts]
|
||||
- "{{ hostkey.results }}"
|
||||
when: birthday is defined
|
||||
|
||||
# from https://github.com/praiskup/ansible-role-fix-root-ssh
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue