remove ip based entries from known_hosts as well
This commit is contained in:
parent
8e809b0cc4
commit
02faa0fa0e
1 changed files with 9 additions and 1 deletions
|
@ -5,7 +5,7 @@
|
||||||
register: host_is_up
|
register: host_is_up
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
|
|
||||||
- name: clean out old known_hosts
|
- name: clean out old known_hosts (name based entries)
|
||||||
local_action: known_hosts path={{item}} host={{inventory_hostname}} state=absent
|
local_action: known_hosts path={{item}} host={{inventory_hostname}} state=absent
|
||||||
ignore_errors: True
|
ignore_errors: True
|
||||||
with_items:
|
with_items:
|
||||||
|
@ -13,6 +13,14 @@
|
||||||
- /etc/ssh/ssh_known_hosts
|
- /etc/ssh/ssh_known_hosts
|
||||||
when: host_is_up|failed
|
when: host_is_up|failed
|
||||||
|
|
||||||
|
- name: clean out old known_hosts (IP based entries)
|
||||||
|
local_action: known_hosts path={{item}} host={{inventory_hostname | ipaddr}} state=absent
|
||||||
|
ignore_errors: True
|
||||||
|
with_items:
|
||||||
|
- /root/.ssh/known_hosts
|
||||||
|
- /etc/ssh/ssh_known_hosts
|
||||||
|
when: host_is_up|failed
|
||||||
|
|
||||||
- name: spin UP VM using nova_compute
|
- name: spin UP VM using nova_compute
|
||||||
sudo: False
|
sudo: False
|
||||||
local_action:
|
local_action:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue