From 0369d0a205ba68ec5691b834a87781fb9120e7b9 Mon Sep 17 00:00:00 2001 From: Thomas Nyambati Date: Fri, 17 Feb 2017 17:02:28 +0300 Subject: [PATCH] ft(ssh connection): test if connection is still valid --- tasks/main.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tasks/main.yml b/tasks/main.yml index 00cf46e..e461b20 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -28,4 +28,5 @@ key: "{{ lookup('file', key_path + '.pub') }}" - name: Test if the new ssh key is allowed to make connections - set_fact: ansible_private_ssh_key={{ lookup('file', key_path)}} + shell: ssh {{ssh_host_user }}@{{ inventory_hostname }} "echo success" + delegate_to: localhost