2020-03-15 12:00:10 +01:00
|
|
|
---
|
|
|
|
|
|
|
|
- name: certbot package is removed
|
|
|
|
apt:
|
|
|
|
name: certbot
|
|
|
|
state: absent
|
|
|
|
|
|
|
|
- include_role:
|
|
|
|
name: evolix/remount-usr
|
|
|
|
|
2021-01-07 18:55:44 +01:00
|
|
|
# - name: Certbot script is downloaded
|
|
|
|
# get_url:
|
|
|
|
# url: https://dl.eff.org/certbot-auto
|
|
|
|
# dest: /usr/local/bin/certbot
|
|
|
|
# mode: '0755'
|
|
|
|
# owner: root
|
|
|
|
# group: root
|
|
|
|
# force: no
|
|
|
|
# notify: install certbot-auto
|
|
|
|
|
|
|
|
- name: Let's Encrypt script is present
|
|
|
|
copy:
|
|
|
|
src: letsencrypt-auto
|
|
|
|
dest: /usr/local/bin/letsencrypt-auto
|
2020-03-15 12:00:10 +01:00
|
|
|
mode: '0755'
|
|
|
|
owner: root
|
|
|
|
group: root
|
2021-01-07 18:55:44 +01:00
|
|
|
force: yes
|
|
|
|
notify: install letsencrypt-auto
|
|
|
|
|
|
|
|
- name: Check certbot script
|
|
|
|
stat:
|
|
|
|
path: /usr/local/bin/certbot
|
|
|
|
register: certbot_path
|
|
|
|
|
|
|
|
- name: Rename certbot script if present
|
|
|
|
command: "mv /usr/local/bin/certbot /usr/local/bin/certbot.bak"
|
|
|
|
when: certbot_path.stat.exists
|
|
|
|
|
|
|
|
- name: Let's Encrypt script is symlinked as certbot
|
|
|
|
file:
|
|
|
|
src: "/usr/local/bin/letsencrypt-auto"
|
|
|
|
dest: "/usr/local/bin/certbot"
|
|
|
|
state: link
|
2020-03-15 12:00:10 +01:00
|
|
|
|
|
|
|
- name: systemd artefacts are absent
|
|
|
|
file:
|
|
|
|
dest: "{{ item }}"
|
|
|
|
state: absent
|
|
|
|
loop:
|
|
|
|
- /etc/systemd/system/certbot.service
|
|
|
|
- /etc/systemd/system/certbot.service.d
|
|
|
|
- /etc/systemd/system/certbot.timer
|
|
|
|
notify: systemd daemon-reload
|
|
|
|
|
|
|
|
- name: custom crontab is present
|
|
|
|
copy:
|
|
|
|
src: cron_jessie
|
|
|
|
dest: /etc/cron.d/certbot
|
|
|
|
force: yes
|