diff --git a/salt/vpn/openvpn.sls b/salt/vpn/openvpn.sls index 208f9e3..e8bb0be 100644 --- a/salt/vpn/openvpn.sls +++ b/salt/vpn/openvpn.sls @@ -36,6 +36,16 @@ hostroutes-{{ name }}: name: {{ name }} - mode: 755 +/etc/systemd/system/openvpn@{{ name }}.service.d: + file.directory: + - user: root + +/etc/systemd/system/openvpn@{{ name }}.service.d/restart.conf: + file.managed: + - source: salt://vpn/systemd-restart.conf + - mode: 644 + - require: + - file: /etc/systemd/system/openvpn@{{ name }}.service.d autostart-{{ name }}: service.enabled: diff --git a/salt/vpn/systemd-restart.conf b/salt/vpn/systemd-restart.conf new file mode 100644 index 000000000..f3306f7 --- /dev/null +++ b/salt/vpn/systemd-restart.conf @@ -0,0 +1,3 @@ +[Service] +Restart=always +RestartSec=10s