Created
October 14, 2020 13:18
-
-
Save Jyrno42/90a1d71a622c709510465e3a822b2160 to your computer and use it in GitHub Desktop.
certbot ansible role
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- name: Install latest certbot-auto | |
get_url: | |
url: https://dl.eff.org/certbot-auto | |
dest: /usr/local/bin/certbot-auto | |
mode: a+x | |
- name: Run --version to make sure certbot-auto creates it's venv | |
command: /usr/local/bin/certbot-auto --version -n | |
- name: Create directories | |
action: file state=directory path={{ item }} | |
with_items: | |
- /etc/letsencrypt | |
- /etc/letsencrypt/configs | |
- /etc/letsencrypt/www | |
- name: Ensure cron log file exists | |
action: file state=touch path="/var/log/certbot-cron-output.log" | |
- name: Add renewal cron | |
cron: | |
name="certbot renew" | |
minute="01" | |
hour="01,12" | |
user="root" | |
job="bash -c '/usr/local/bin/certbot-auto renew --agree-tos --non-interactive --post-hook \"docker exec nginx nginx -s reload\" --no-self-upgrade' >> /var/log/certbot-cron-output.log 2>&1" | |
cron_file="certbot" | |
- name: Add certbot upgrade cron | |
cron: | |
name="certbot upgrade" | |
minute="01" | |
hour="01" | |
day="3" | |
user="root" | |
job="bash -c '/usr/local/bin/certbot-auto --version' >> /var/log/certbot-cron-output.log 2>&1" | |
cron_file="certbot" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment