infra/roles/stable/nginx/tasks/certbot.yml
2021-02-10 22:56:05 +01:00

23 lines
591 B
YAML

---
- name: Install snapd
become: yes
apt:
pkg: ['snapd']
- name: Install snap core
become: yes
snap:
name: core
- name: Install cerbot via snap
become: yes
snap:
name: certbot
classic: yes
- name: Generate certificate if needed
become: yes
command: /snap/bin/certbot --nginx --non-interactive --agree-tos
--domains {{ fpm_services | items2dict(key_name='server_name', value_name='server_name') | join(',') }}
{{ reverse_services | items2dict(key_name='server_name', value_name='server_name') | join(',') }}
--email {{certbot_email}}