--- - meta: flush_handlers - name: "Issue certificate for {{ domain }}" command: >- ./acme.sh --issue --domain "{{ domain }}" --webroot "/var/www/validation" args: chdir: "~/.acme.sh" register: acme_issue_result failed_when: acme_issue_result.rc != 0 and "Domains not changed" not in acme_issue_result.stdout - name: "Install certificate for {{ domain }}" command: >- ./acme.sh --install-cert --domain "{{ domain }}" --key-file "{{ acme_key_location }}" --fullchain-file "{{ acme_certificate_location }}" --reloadcmd "service nginx force-reload" args: chdir: "~/.acme.sh" creates: "{{ acme_key_location }}" register: acme_install_result failed_when: acme_install_result.rc != 0 and "Reload error for" not in acme_install_result.stderr