1
0
mirror of https://github.com/balkian/gists.git synced 2024-11-21 17:22:29 +00:00
gists/ansible letsencrypt/letsencrypt.yml
J. Fernando Sánchez f48bab94dd Move files
2021-10-30 15:23:01 +02:00

20 lines
769 B
YAML

- hosts: all
name: "Let's encrypt"
tasks:
- name: Add certbot to crontab
cron: name="Letsencrypt certificates" month="*/2" minute=5 hour=0
cron_file="letsencrypt-autoupdate"
user="root"
job="/usr/bin/docker run -t --rm --name certbot \
-v '/etc/letsencrypt/:/etc/letsencrypt' \
-v '/var/lib/letsencrypt:/var/lib/letsencrypt' \
-v '/var/www/letsencrypt:/webroot' \
quay.io/letsencrypt/letsencrypt:latest auth --webroot -w /webroot/ \
-m {{ le_admin }} \
--expand --agree-tos --keep --quiet \
-d {{ le_domains | join(' -d ') }}"
vars:
le_admin: admin@admin.com
le_domains:
- admin.com
become: yes