dhcp: cron.d entry + let main.py restart the server

This commit is contained in:
Yohaï-Eliel BERREBY 2020-04-06 19:03:10 +02:00
parent 6cce62850d
commit 8579b99b2e
2 changed files with 17 additions and 6 deletions

View file

@ -27,6 +27,19 @@
dest: /etc/logrotate.d/dhcp
mode: 0644
- name: set up cron to reload dhcp re2o service
cron:
# Do not change this name or idempotence *might* be lost.
name: dhcp-re2o-service
cron_file: re2o-services
minute: "*"
hour: "*"
day: "*"
weekday: "*"
month: "*"
user: root
job: "/usr/bin/python3 /var/local/re2o-services/dhcp/main.py"
- name: restart rsyslog
systemd:
name: rsyslog
@ -50,9 +63,3 @@
src: dhcp/dhcpd.conf.j2
dest: /etc/dhcp/dhcpd.conf
mode: 0600
- name: Ensure that isc-dhcp-server is started / reloaded
systemd:
name: isc-dhcp-server
state: restarted
enabled: true

View file

@ -0,0 +1,4 @@
# Régénération des services re2o
# Régénération du dhcp
* * * * * root /usr/bin/python3 /var/local/re2o-services/dhcp/main.py