Don't try to restart a service, when no service is defined.

This commit is contained in:
Tim Bultmann 2018-01-23 11:02:34 +01:00
parent 3f1a802d71
commit 320e1a0e98
2 changed files with 3 additions and 3 deletions

View File

@ -19,7 +19,7 @@ certbot_certs: []
# - example3.com
certbot_create_command: "{{ certbot_script }} certonly --standalone --noninteractive --agree-tos --email {{ cert_item.email | default(certbot_admin_email) }} -d {{ cert_item.domains | join(',') }}"
certbot_create_standalone_stop_services:
- nginx
# - nginx
# - apache
# - varnish

View File

@ -8,7 +8,7 @@
service:
name: "{{ item }}"
state: stopped
when: not letsencrypt_cert.stat.exists
when: not letsencrypt_cert.stat.exists and item != None
with_items: "{{ certbot_create_standalone_stop_services }}"
- name: Generate new certificate if one doesn't exist.
@ -19,5 +19,5 @@
service:
name: "{{ item }}"
state: started
when: not letsencrypt_cert.stat.exists
when: not letsencrypt_cert.stat.exists and item != None
with_items: "{{ certbot_create_standalone_stop_services }}"