mirror of
https://github.com/geerlingguy/ansible-role-certbot.git
synced 2025-04-19 17:01:37 +02:00
25 lines
883 B
YAML
25 lines
883 B
YAML
---
|
|
- name: Add cron job for certbot renewal (if configured).
|
|
cron:
|
|
name: Certbot automatic renewal.
|
|
job: "{{ certbot_script }} renew {{ certbot_auto_renew_options }}"
|
|
minute: "{{ certbot_auto_renew_minute }}"
|
|
hour: "{{ certbot_auto_renew_hour }}"
|
|
user: "{{ certbot_auto_renew_user }}"
|
|
when: certbot_install_from_source or ansible_service_mgr != "systemd"
|
|
|
|
- block:
|
|
- name: Remove cron job for certbot renewal.
|
|
cron:
|
|
name: Certbot automatic renewal.
|
|
state: absent
|
|
- name: Adapt systemd unit for renewal
|
|
lineinfile:
|
|
path: /lib/systemd/system/certbot.service
|
|
regexp: ^ExecStart=.*
|
|
line: ExecStart={{ certbot_script }} renew {{ certbot_auto_renew_options }}
|
|
when:
|
|
# certbot packages come with a timer unit for this job
|
|
- not certbot_install_from_source
|
|
- ansible_service_mgr == "systemd"
|