mirror of
https://github.com/geerlingguy/ansible-role-certbot.git
synced 2026-09-20 11:50:40 +02:00
Don't try to restart a service, when no service is defined.
This commit is contained in:
+1
-1
@@ -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
|
||||
|
||||
|
||||
@@ -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 }}"
|
||||
|
||||
Reference in New Issue
Block a user