From 6dd60cb3e12ce130d438ea890c94490cdb21e19a Mon Sep 17 00:00:00 2001
From: jurgenhaas <juergen@paragon-es.de>
Date: Tue, 2 Jan 2018 17:19:05 +0100
Subject: [PATCH] Make sure this is working even if run on limited inventory

---
 tasks/tunnel_keys.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tasks/tunnel_keys.yml b/tasks/tunnel_keys.yml
index 91ff270..2e8a525 100644
--- a/tasks/tunnel_keys.yml
+++ b/tasks/tunnel_keys.yml
@@ -11,4 +11,4 @@
     key="{{ hostvars[item].pubkey.stdout }} {{ item }}"
     path='/home/{{ tunnel_user_name }}/.ssh/fresh_auth_keys_tunnel_{{ item }}'
   with_items: '{{ groups.all }}'
-  when: item != "localhost" and inventory_hostname != "localhost"
+  when: item != "localhost" and inventory_hostname != "localhost" and hostvars[item].pubkey is defined
-- 
GitLab