add nginx checking

This commit is contained in:
2026-01-14 21:00:50 -07:00
parent 50bbc94af9
commit 90d2cbd6a9

View File

@@ -16,12 +16,14 @@
service: service:
name: nginx name: nginx
state: stopped state: stopped
when: "'nginx' in ansible_facts.packages" # Checks if 'nginx' key exists in the gathered facts
- name: Generate initial cert - name: Generate initial cert
command: 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 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 chdir: /root
creates: "/root/.lego/certificates/{{ inventory_hostname | default(cert_domain) }}.crt" 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 - name: Start nginx after generating initial lego cert
service: service: