From 68b710ee8d76007b4a6e7923755f963d57281bd5 Mon Sep 17 00:00:00 2001 From: Markus Katharina Brechtel Date: Wed, 13 Sep 2017 17:25:30 +0000 Subject: [PATCH] fetching for direct host connection --- tasks/fetch.yml | 2 +- tasks/main.yml | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/tasks/fetch.yml b/tasks/fetch.yml index befb6d6..bc6b435 100644 --- a/tasks/fetch.yml +++ b/tasks/fetch.yml @@ -2,7 +2,7 @@ - name: fetch ssh host key command: - cat "{{ root_target_directory }}/etc/ssh/ssh_host_{{ ssh_host_key_type }}_key.pub" + cat "{{ root_target_directory | default("") }}/etc/ssh/ssh_host_{{ ssh_host_key_type }}_key.pub" register: _ssh_host_key_cat_result changed_when: false diff --git a/tasks/main.yml b/tasks/main.yml index 8ff79a8..3fb4e27 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -10,12 +10,10 @@ ssh_host_key_state is defined and ssh_host_key_state == 'setup' -# TODO fail when root_target_directory is not defined - include: fetch.yml when: - root_target_directory is defined and ( not ssh_host_key_state is defined or - ssh_host_key_state == 'fetched' ) + ssh_host_key_state == 'fetched' - include: save.yml