ansible-role-certbot/tasks/base.yml

52 lines
1.1 KiB
YAML
Raw Normal View History

2018-11-29 17:55:28 +00:00
---
2018-06-10 17:34:06 +00:00
- name: install certbot package
2021-08-24 16:18:42 +00:00
ansible.builtin.apt:
name:
2018-11-25 19:24:19 +00:00
- certbot
- cron
2021-08-24 16:18:42 +00:00
default_release: '{{ certbot_distribution|default(ansible_distribution_release) }}'
state: present
2018-06-10 17:34:06 +00:00
tags: certbot
- name: create webroot path directory
2021-08-24 16:18:42 +00:00
ansible.builtin.file:
2018-06-10 17:34:06 +00:00
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
2021-08-24 16:18:42 +00:00
ansible.builtin.copy:
2018-07-07 17:24:56 +00:00
src: certbot-renew
dest: /usr/local/bin/certbot-renew
owner: root
group: root
mode: 0755
tags: certbot
- name: install certbot renew configuration
2021-08-24 16:18:42 +00:00
ansible.builtin.template:
2018-07-07 17:24:56 +00:00
src: renew.cfg.j2
dest: /etc/letsencrypt/renew.cfg
owner: root
group: root
mode: 0644
tags: certbot
- name: remove old cerbot renew cron
2021-08-24 16:18:42 +00:00
ansible.builtin.file:
2018-07-07 17:24:56 +00:00
path: /etc/cron.d/certbot
state: absent
tags: certbot
- name: add certbot renew cron
2021-08-24 16:18:42 +00:00
ansible.builtin.cron:
name: certbot-renew
user: root
hour: '*/12'
2021-08-24 16:18:42 +00:00
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