From 57aaf9c12357420d1d42ef331e66e5cbc2977115 Mon Sep 17 00:00:00 2001 From: Edoardo Putti Date: Fri, 18 May 2018 11:33:23 +0200 Subject: [PATCH] handle creation of ssh certificate when none --- roles/ssh_server/tasks/main.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/roles/ssh_server/tasks/main.yaml b/roles/ssh_server/tasks/main.yaml index 99e026d..5a3a41f 100644 --- a/roles/ssh_server/tasks/main.yaml +++ b/roles/ssh_server/tasks/main.yaml @@ -34,6 +34,7 @@ - name: Validate SSH host certificate if any ssh_cert: register: ssh_verification + ignore_errors: yes - debug: var: ssh_verification @@ -109,7 +110,7 @@ dest: "/etc/ssh/ssh_host_ed25519_key-cert.pub" register: set_pub_key notify: restart ssh - when: not ssh_verification + when: ssh_verification.failed - name: add certificate to sshd config lineinfile: