Skip comment lines when adding host ssh keys
This commit is contained in:
parent
e716951798
commit
c8918b1a35
1 changed files with 1 additions and 1 deletions
|
@ -165,7 +165,7 @@
|
||||||
path: /root/.ssh/known_hosts
|
path: /root/.ssh/known_hosts
|
||||||
key: "{{ item }}"
|
key: "{{ item }}"
|
||||||
host: "{{ inventory_hostname }}"
|
host: "{{ inventory_hostname }}"
|
||||||
with_items: "{{ hostkeys.stdout.splitlines() }}"
|
with_items: "{{ hostkeys.stdout.splitlines() | reject('match', '^#.*') }}"
|
||||||
delegate_to: localhost
|
delegate_to: localhost
|
||||||
when: inventory_hostname not in result.list_vms
|
when: inventory_hostname not in result.list_vms
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue