You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
1.1 KiB
YAML
47 lines
1.1 KiB
YAML
---
|
|
|
|
- name: Create source directory
|
|
file:
|
|
path: "{{ acme_source_directory | dirname }}"
|
|
state: "directory"
|
|
owner: "root"
|
|
group: "root"
|
|
mode: "0755"
|
|
|
|
- name: Download acme.sh
|
|
git:
|
|
repo: "{{ acme_source_repository }}"
|
|
version: "{{ acme_source_version }}"
|
|
dest: "{{ acme_source_directory }}"
|
|
update: no
|
|
|
|
# TODO Create custom user for certificate validations
|
|
|
|
- name: Configure acme.sh
|
|
command: >-
|
|
./acme.sh --install --log
|
|
--days 30
|
|
--accountemail {{ acme_account_mail }}
|
|
args:
|
|
chdir: "{{ acme_source_directory }}"
|
|
creates: "~/.acme.sh/acme.sh"
|
|
|
|
- name: Determine if acme.sh is installed
|
|
stat:
|
|
path: "~/.acme.sh/acme.sh"
|
|
register: acme_installed
|
|
|
|
- name: Upgrade acme.sh
|
|
command: ./acme.sh --upgrade
|
|
args:
|
|
chdir: "~/.acme.sh"
|
|
when:
|
|
- acme_installed.stat.exists
|
|
register: acme_upgrade_results
|
|
changed_when: acme_upgrade_results.rc == 0 and "Upgrade success" in acme_upgrade_results.stdout
|
|
|
|
- name: Create directory for certificates
|
|
file:
|
|
path: "{{ acme_certificates_directory }}"
|
|
state: "directory"
|