add nginx checking
This commit is contained in:
@@ -16,12 +16,14 @@
|
||||
service:
|
||||
name: nginx
|
||||
state: stopped
|
||||
when: "'nginx' in ansible_facts.packages" # Checks if 'nginx' key exists in the gathered facts
|
||||
|
||||
- name: Generate initial cert
|
||||
command:
|
||||
cmd: /usr/local/bin/lego -a --email="{{ letsencrypt_email }}" --domains="{{ inventory_hostname | default(cert_domain) }}" --key-type {{ cert_key_type | default('rsa4096') }} --http run
|
||||
chdir: /root
|
||||
creates: "/root/.lego/certificates/{{ inventory_hostname | default(cert_domain) }}.crt"
|
||||
when: "'nginx' in ansible_facts.packages" # Checks if 'nginx' key exists in the gathered facts
|
||||
|
||||
- name: Start nginx after generating initial lego cert
|
||||
service:
|
||||
|
||||
Reference in New Issue
Block a user