From b9771f67b3780debf36024c0a1fd9cd2e0ed7b35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=2E=20Fernando=20S=C3=A1nchez?= Date: Mon, 28 Nov 2016 11:59:15 +0100 Subject: [PATCH] --- letsencrypt.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 letsencrypt.yml diff --git a/letsencrypt.yml b/letsencrypt.yml new file mode 100644 index 0000000..4a0f9c1 --- /dev/null +++ b/letsencrypt.yml @@ -0,0 +1,20 @@ +- 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 \ No newline at end of file