automatic service restarting

This commit is contained in:
Astro 2016-11-17 15:35:39 +01:00
parent 24ed406026
commit 64635320a5
4 changed files with 19 additions and 6 deletions

View File

@ -1,5 +1,7 @@
isc-dhcp-server:
pkg.installed: []
service:
- running
/etc/dhcp/dhcpd.conf:
file.managed:
@ -20,8 +22,10 @@ autostart-dhcpd:
start-dhcpd:
service.running:
- name: isc-dhcp-server
require_in:
- file: /etc/dhcp/dhcpd.conf
- file: /etc/default/isc-dhcp-server
- name: isc-dhcp-server
require_in:
- file: /etc/dhcp/dhcpd.conf
- file: /etc/default/isc-dhcp-server
watch:
- pkg: isc-dhcp-server
- file: /etc/dhcp/dhcpd.conf

View File

@ -24,6 +24,8 @@ start-{{ daemon }}:
- name: {{ daemon }}
require:
- service: autostart-{{ daemon }}
watch:
- file: /etc/quagga/{{ daemon }}.conf
{%- endfor %}

View File

@ -1,5 +1,10 @@
unbound:
pkg.installed: []
service:
- running
- watch:
- pkg: unbound
- file: /etc/unbound/unbound.conf.d/listen.conf
/etc/unbound/unbound.conf.d/listen.conf:
file.managed:

View File

@ -65,8 +65,10 @@ start-{{ name }}:
require_in:
- file: /etc/openvpn/{{ name }}.conf
- file: /etc/openvpn/{{ name }}.auth
watch:
- file: /etc/openvpn/{{ name }}.conf
- file: /etc/openvpn/{{ name }}.auth
require:
- file: /dev/net/tun
{%- endfor %}