From fbd38e1889c2f6d403d14f6cc7ee53e625120784 Mon Sep 17 00:00:00 2001 From: Ralph Bean Date: Wed, 13 May 2015 20:19:14 +0000 Subject: [PATCH] Move known_hosts scrubbing to a more reasonable place. --- playbooks/hosts/taiga.cloud.fedoraproject.org.yml | 6 ------ tasks/persistent_cloud_new.yml | 8 ++++++++ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/playbooks/hosts/taiga.cloud.fedoraproject.org.yml b/playbooks/hosts/taiga.cloud.fedoraproject.org.yml index bd00f56120..d0a82a4d06 100644 --- a/playbooks/hosts/taiga.cloud.fedoraproject.org.yml +++ b/playbooks/hosts/taiga.cloud.fedoraproject.org.yml @@ -12,12 +12,6 @@ tasks: - include: "{{ tasks }}/persistent_cloud_new.yml" - - name: clean out old known_hosts for copr-be-dev - local_action: known_hosts path={{item}} host=copr-be-dev.cloud.fedoraproject.org state=absent - ignore_errors: True - with_items: - - /root/.ssh/known_hosts - - /etc/ssh/ssh_known_hosts - include: "{{ tasks }}/growroot_cloud.yml" - name: setup all the things diff --git a/tasks/persistent_cloud_new.yml b/tasks/persistent_cloud_new.yml index cae00c05ad..3ffc457ea0 100644 --- a/tasks/persistent_cloud_new.yml +++ b/tasks/persistent_cloud_new.yml @@ -5,6 +5,14 @@ register: host_is_up ignore_errors: true +- name: clean out old known_hosts + local_action: known_hosts path={{item}} host={{inventory_hostname}} 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: