mirror of
https://github.com/geerlingguy/ansible-role-certbot.git
synced 2025-04-19 17:01:37 +02:00
Use shell script to stop/start services
This commit is contained in:
parent
3f1a802d71
commit
ca8ad58678
11
files/certbot-auto-renew-script.j2
Normal file
11
files/certbot-auto-renew-script.j2
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
{% for serv in certbot_standalone_stop_services %}
|
||||||
|
service {{ serv }} stop
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
{{ certbot_script }} renew {{ certbot_auto_renew_options }}
|
||||||
|
|
||||||
|
{% for serv in certbot_standalone_stop_services %}
|
||||||
|
service {{ serv }} start
|
||||||
|
{% endfor %}
|
@ -1,8 +1,15 @@
|
|||||||
---
|
---
|
||||||
|
- name: Create certbot renewal script.
|
||||||
|
template:
|
||||||
|
src: files/certbot-auto-renew-script.j2
|
||||||
|
dest: /opt/certbot-auto-renew-script.sh
|
||||||
|
owner: "{{ certbot_auto_renew_user }}"
|
||||||
|
mode: 0744
|
||||||
|
|
||||||
- name: Add cron job for certbot renewal (if configured).
|
- name: Add cron job for certbot renewal (if configured).
|
||||||
cron:
|
cron:
|
||||||
name: Certbot automatic renewal.
|
name: Certbot automatic renewal.
|
||||||
job: "{{ certbot_script }} renew {{ certbot_auto_renew_options }}"
|
job: "/opt/certbot-auto-renew-script.sh"
|
||||||
minute: "{{ certbot_auto_renew_minute }}"
|
minute: "{{ certbot_auto_renew_minute }}"
|
||||||
hour: "{{ certbot_auto_renew_hour }}"
|
hour: "{{ certbot_auto_renew_hour }}"
|
||||||
user: "{{ certbot_auto_renew_user }}"
|
user: "{{ certbot_auto_renew_user }}"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user