2020-11-21 23:42:08 +01:00
|
|
|
---
|
|
|
|
- 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
|
2020-12-28 17:39:41 +01:00
|
|
|
command: /snap/bin/certbot --nginx --non-interactive --agree-tos
|
2020-11-21 23:42:08 +01:00
|
|
|
--domains {{ servers | items2dict(key_name='server_name', value_name='server_name') | join(',') }}
|
|
|
|
--email {{certbot_email}}
|