From 4e89a01160eee7849d45ce89d133d86acbf4af4b Mon Sep 17 00:00:00 2001 From: Jonathan DeMasi Date: Wed, 14 Jan 2026 20:48:56 -0700 Subject: [PATCH] Add logic for hosts without nginx that still need certs --- ansible/roles/lego/tasks/initial_cert.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ansible/roles/lego/tasks/initial_cert.yaml b/ansible/roles/lego/tasks/initial_cert.yaml index 8a1085b..3b8b1d6 100644 --- a/ansible/roles/lego/tasks/initial_cert.yaml +++ b/ansible/roles/lego/tasks/initial_cert.yaml @@ -2,6 +2,7 @@ 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: @@ -13,3 +14,4 @@ service: name: nginx state: started + when: "'nginx' in ansible_facts.packages" # Checks if 'nginx' key exists in the gathered facts