2020-11-02 04:51:35 +01:00
|
|
|
---
|
|
|
|
- name: Copy shell script to enable tls sites
|
2021-02-04 18:22:01 +01:00
|
|
|
become: true
|
2023-03-07 19:28:51 +01:00
|
|
|
ansible.builtin.copy:
|
2020-11-02 04:51:35 +01:00
|
|
|
src: 'files/acmetool/enable_tls.sh'
|
|
|
|
dest: '/etc/acme/hooks/enable_tls.sh'
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 'u=rx,g=r,o='
|
|
|
|
|
|
|
|
- name: Get certificate for default server
|
2021-02-04 18:22:01 +01:00
|
|
|
become: true
|
2023-03-07 19:28:51 +01:00
|
|
|
ansible.builtin.command:
|
|
|
|
cmd: "acmetool want '{{ inventory_hostname }}'"
|
2020-11-02 04:51:35 +01:00
|
|
|
args:
|
|
|
|
creates: '/var/lib/acme/live/{{ inventory_hostname }}'
|
|
|
|
|
|
|
|
- name: Get certificates for all configured sites
|
2021-02-04 18:22:01 +01:00
|
|
|
become: true
|
2023-03-07 19:28:51 +01:00
|
|
|
ansible.builtin.command:
|
|
|
|
cmd: acmetool want '{{ ([site.name] + (site.altnames | default([]))) | join(" ") }}' -> acmetool want '{{ ([site.name] + (site.altnames | default([]))) | join(" ") }}'
|
2020-11-02 04:51:35 +01:00
|
|
|
args:
|
|
|
|
creates: '/var/lib/acme/live/{{ site.name }}/'
|
|
|
|
with_items: '{{ nginx_sites }}'
|
|
|
|
loop_control:
|
|
|
|
loop_var: site
|