From 8927aba6a35578065a3906b8de28db6feba7986d Mon Sep 17 00:00:00 2001 From: Kevin Fenzi Date: Tue, 7 Nov 2017 18:39:25 +0000 Subject: [PATCH] try and adjust cloud deployment to handle strict ssh keys --- tasks/persistent_cloud.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tasks/persistent_cloud.yml b/tasks/persistent_cloud.yml index 6658ada121..110e86ef8b 100644 --- a/tasks/persistent_cloud.yml +++ b/tasks/persistent_cloud.yml @@ -62,6 +62,19 @@ pause: seconds=30 when: host_is_up|failed +- name: gather ssh host key from new instance + local_action: command ssh-keyscan -t rsa {{ inventory_hostname }} + ignore_errors: True + register: hostkey + when: host_is_up|failed + +- name: add new ssh host key (until we can sign it) + local_action: known_hosts path={{item}} key="{{ hostkey.stdout }}" host={{ inventory_hostname }} state=present + ignore_errors: True + with_items: + - /root/.ssh/known_hosts + when: host_is_up|failed + # # Next we try and gather facts. If the host doesn't have python2 this will fail. #