summaryrefslogtreecommitdiffstats
path: root/tasks
diff options
context:
space:
mode:
authorMiroslav Suchý <msuchy@redhat.com>2015-11-30 09:20:50 +0100
committerMiroslav Suchý <msuchy@redhat.com>2015-11-30 09:20:50 +0100
commit02faa0fa0ea3fe4f2d02e613bcf4cf6f283c81f5 (patch)
treebf64f3190dc2bf08cf7e9acc72d15cac14a86df6 /tasks
parent8e809b0cc412d489f0d6dc369024279794ee709b (diff)
downloadansible-02faa0fa0ea3fe4f2d02e613bcf4cf6f283c81f5.tar.gz
ansible-02faa0fa0ea3fe4f2d02e613bcf4cf6f283c81f5.tar.xz
ansible-02faa0fa0ea3fe4f2d02e613bcf4cf6f283c81f5.zip
remove ip based entries from known_hosts as well
Diffstat (limited to 'tasks')
-rw-r--r--tasks/persistent_cloud_new.yml10
1 files changed, 9 insertions, 1 deletions
diff --git a/tasks/persistent_cloud_new.yml b/tasks/persistent_cloud_new.yml
index 184a93a1b..a69fe5f4c 100644
--- a/tasks/persistent_cloud_new.yml
+++ b/tasks/persistent_cloud_new.yml
@@ -5,7 +5,7 @@
register: host_is_up
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
ignore_errors: True
with_items:
@@ -13,6 +13,14 @@
- /etc/ssh/ssh_known_hosts
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
sudo: False
local_action: