From 73e6d0b7edb062e3c132df05ac74f3557d8dee9b Mon Sep 17 00:00:00 2001 From: Alan Orth Date: Tue, 31 Oct 2017 23:18:15 +0200 Subject: [PATCH] roles/nginx: Fix issue raised by ansible-lint [ANSIBLE0006] systemctl used in place of systemd module Also, move the functionality of the changed check to the systemd task, because it has the ability to simply daemon-reload itself now. --- roles/nginx/tasks/letsencrypt.yml | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/roles/nginx/tasks/letsencrypt.yml b/roles/nginx/tasks/letsencrypt.yml index 88051d0..8f448e9 100644 --- a/roles/nginx/tasks/letsencrypt.yml +++ b/roles/nginx/tasks/letsencrypt.yml @@ -2,19 +2,13 @@ - name: Copy systemd service to renew Let's Encrypt certs template: src=renew-letsencrypt.service.j2 dest=/etc/systemd/system/renew-letsencrypt.service mode=0644 owner=root group=root - register: letsencrypt_service - name: Copy systemd timer to renew Let's Encrypt certs copy: src=renew-letsencrypt.timer dest=/etc/systemd/system/renew-letsencrypt.timer mode=0644 owner=root group=root - register: letsencrypt_timer - -# need to reload to pick up service/timer changes -- name: Reload systemd daemon - command: /bin/systemctl daemon-reload - when: letsencrypt_service|changed or letsencrypt_timer|changed +# always issues daemon-reload just in case the server/timer changed - name: Start and enable systemd timer to renew Let's Encrypt certs - service: name=renew-letsencrypt.timer state=started enabled=yes + systemd: name=renew-letsencrypt.timer state=started enabled=yes daemon_reload=yes - name: Download certbot get_url: dest={{ letsencrypt_certbot_dest }} url=https://dl.eff.org/certbot-auto mode=700