Skip to content

Commit 59e6f61

Browse files
committed
haproxy: remove default acme cronjob and install a new cronjob in /etc/cron.d/
1 parent f5df06c commit 59e6f61

2 files changed

Lines changed: 18 additions & 0 deletions

File tree

roles/haproxy/defaults/main.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,6 @@ haproxy_acmedns:
4545
password: "password"
4646
subdomain: "a_subdomain"
4747
fulldomain: "a_subdomain.acme-dns.example.org"
48+
49+
# on which weekday (cron, 0==sunday) to run the renewal script
50+
haproxy_acme_cronjob_dow: 1

roles/haproxy/tasks/acme.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,18 @@
5454
register: "acme_account"
5555
become: true
5656
become_user: "acme"
57+
58+
- name: Remove default cronjob for renewal
59+
ansible.builtin.file:
60+
path: "/var/spool/cron/crontabs/acme"
61+
state: "absent"
62+
63+
- name: Install cronjob for renewal
64+
ansible.builtin.copy:
65+
dest: "/etc/cron.d/acme-renew"
66+
owner: "root"
67+
group: "root"
68+
mode: "0644"
69+
content: |
70+
MAILTO=surfconext-beheer@surf.nl
71+
30 07 * * {{ haproxy_acme_cronjob_dow }} acme /home/acme/.acme.sh/acme.sh --cron --home /home/acme/.acme.sh > /dev/null

0 commit comments

Comments
 (0)