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