ansible-acme-sh/tasks/main.yml

94 lines
2.6 KiB
YAML

---
- name: Determine if acme.sh is installed
stat:
path: "~/.acme.sh/acme.sh"
register: is_acme_sh_installed
become_user: "{{ acme_sh_become_user }}"
- import_tasks: install.yml
tags:
- acme_sh
- acme_sh.install
when:
- not acme_sh_uninstall
- not is_acme_sh_installed.stat.exists
- import_tasks: upgrade.yml
tags:
- acme_sh
- acme_sh.upgrade
when:
- is_acme_sh_installed.stat.exists is defined and is_acme_sh_installed.stat.exists
- acme_sh_upgrade == False
- not acme_sh_uninstall
- import_tasks: uninstall.yml
tags:
- acme_sh
- acme_sh.uninstall
when:
- acme_sh_uninstall
- is_acme_sh_installed.stat.exists
- import_tasks: remove_cert.yml
tags:
- acme_sh
- acme_sh.remove_cert
when:
- acme_sh_domains and item.domains is defined and item.domains
- item.remove is defined and item.remove
- not acme_sh_uninstall
- import_tasks: custom_command.yml
tags:
- acme_sh
- acme_sh.custom-command
when:
- acme_sh_domains and item.domains is defined and item.domains
- item.dns_provider | default(acme_sh_default_dns_provider)
- item.dns_provider_api_keys | default(acme_sh_default_dns_provider_api_keys)
- item.custom_command is defined and item.custom_command
- item.remove is undefined or not item.remove
- not acme_sh_uninstall
- import_tasks: issue_cert.yml
tags:
- acme_sh
- acme_sh.issue_cert
when:
- acme_sh_domains and item.domains is defined and item.domains
- item.dns_provider | default(acme_sh_default_dns_provider)
- item.dns_provider_api_keys | default(acme_sh_default_dns_provider_api_keys)
- item.force_renew is undefined or not item.force_renew
- item.custom_command is undefined or not item.custom_command
- item.remove is undefined or not item.remove
- not acme_sh_uninstall
- import_tasks: force_renew_cert.yml
tags:
- acme_sh
- acme_sh.force_renew_cert
when:
- acme_sh_domains and item.domains is defined and item.domains
- item.force_issue is undefined or not item.force_issue
- item.force_renew is defined and item.force_renew
- item.remove is undefined or not item.remove
- not acme_sh_uninstall
- import_tasks: install_cert.yml
tags:
- acme_sh
- acme_sh.install_cert
when:
- acme_sh_domains and item.domains is defined and item.domains
- item.custom_command is undefined or not item.custom_command
- item.remove is undefined or not item.remove
- not acme_sh_uninstall
- import_tasks: list_cert.yml
tags:
- acme_sh
- acme_sh.list
when: acme_sh_list_domains and not acme_sh_uninstall