2018-06-10 17:34:06 +00:00
|
|
|
- name: install certbot package
|
|
|
|
apt:
|
2018-11-25 19:24:19 +00:00
|
|
|
name: '{{ packages }}'
|
2018-06-10 17:34:06 +00:00
|
|
|
default_release: '{{ certbot_distribution|default(ansible_distribution_release) }}'
|
|
|
|
state: present
|
2018-11-25 19:24:19 +00:00
|
|
|
vars:
|
|
|
|
packages:
|
|
|
|
- certbot
|
|
|
|
- cron
|
2018-06-10 17:34:06 +00:00
|
|
|
tags: certbot
|
|
|
|
|
|
|
|
- name: create webroot path directory
|
|
|
|
file:
|
|
|
|
path: '{{ certbot_path }}'
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0755
|
|
|
|
state: directory
|
|
|
|
tags: certbot
|
2018-07-07 17:24:56 +00:00
|
|
|
|
|
|
|
- name: install certbot-renew binary
|
|
|
|
copy:
|
|
|
|
src: certbot-renew
|
|
|
|
dest: /usr/local/bin/certbot-renew
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0755
|
|
|
|
tags: certbot
|
|
|
|
|
|
|
|
- name: install certbot renew configuration
|
|
|
|
template:
|
|
|
|
src: renew.cfg.j2
|
|
|
|
dest: /etc/letsencrypt/renew.cfg
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0644
|
|
|
|
tags: certbot
|
|
|
|
|
2018-11-25 09:16:09 +00:00
|
|
|
- name: remove old cerbot renew cron
|
|
|
|
file:
|
2018-07-07 17:24:56 +00:00
|
|
|
path: /etc/cron.d/certbot
|
2018-11-25 09:16:09 +00:00
|
|
|
state: absent
|
|
|
|
tags: certbot
|
|
|
|
|
|
|
|
- name: add certbot renew cron
|
|
|
|
cron:
|
|
|
|
name: certbot-renew
|
|
|
|
user: root
|
|
|
|
hour: '*/12'
|
|
|
|
minute: 0
|
|
|
|
job: perl -e 'sleep int(rand(3600))' && certbot -q renew --renew-hook /usr/local/bin/certbot-renew
|
2018-07-07 17:24:56 +00:00
|
|
|
tags: certbot
|