From ed6687d319465d7296c3b91232e4290f2e96c850 Mon Sep 17 00:00:00 2001 From: Patrick Uiterwijk Date: Mon, 9 Oct 2017 00:30:32 +0000 Subject: [PATCH] Lets just use the .changed Signed-off-by: Patrick Uiterwijk --- roles/basessh/tasks/main.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/roles/basessh/tasks/main.yml b/roles/basessh/tasks/main.yml index 22a564fd62..798103fe43 100644 --- a/roles/basessh/tasks/main.yml +++ b/roles/basessh/tasks/main.yml @@ -163,6 +163,7 @@ copy: src="{{pubkeydir}}/{{inventory_hostname}}{{item}}-cert.pub" dest="{{item}}-cert.pub" with_items: "{{certs_to_sign}}" + register: certcopy notify: - restart sshd tags: @@ -185,7 +186,7 @@ - name: Restart sshd in case we just signed a new certificate so it gets applied service: name=sshd state=restarted - when: "certs_to_sign != []" + when: certcopy.changed tags: - basessh - sshd_cert