From b5b7814581334de983bcab31fb309607d4af8742 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Sch=C3=BCtte?= Date: Tue, 24 Jun 2014 11:59:39 +0200 Subject: [PATCH] openvpn: different up scripts --- files/etc/openvpn/hideme/hideme-up | 5 +++++ files/etc/openvpn/mullvad/mullvad-up | 5 +++++ manifests/init.pp | 10 +++------- 3 files changed, 13 insertions(+), 7 deletions(-) create mode 100644 files/etc/openvpn/hideme/hideme-up create mode 100644 files/etc/openvpn/mullvad/mullvad-up diff --git a/files/etc/openvpn/hideme/hideme-up b/files/etc/openvpn/hideme/hideme-up new file mode 100644 index 0000000..311aaca --- /dev/null +++ b/files/etc/openvpn/hideme/hideme-up @@ -0,0 +1,5 @@ +#!/bin/sh +ip route replace 0.0.0.0/1 via $4 table 42 +ip route replace 128.0.0.0/1 via $4 table 42 +/etc/openvpn/update-dnsmasq-forward +exit 0 diff --git a/files/etc/openvpn/mullvad/mullvad-up b/files/etc/openvpn/mullvad/mullvad-up new file mode 100644 index 0000000..f59a2bd --- /dev/null +++ b/files/etc/openvpn/mullvad/mullvad-up @@ -0,0 +1,5 @@ +#!/bin/sh +ip route replace 0.0.0.0/1 via $5 table 42 +ip route replace 128.0.0.0/1 via $5 table 42 +/etc/openvpn/update-dnsmasq-forward +exit 0 diff --git a/manifests/init.pp b/manifests/init.pp index 3105fa9..fe9b724 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -444,13 +444,9 @@ class ff_gw::vpn($provider, $ca_crt, $usr_crt, $usr_key, $usr_name, $usr_pass, $ ensure => file, content => $ca_crt; "/etc/openvpn/${provider}/${provider}-up": - ensure => file, - mode => '0755', - content => '#!/bin/sh -ip route replace 0.0.0.0/1 via $5 table 42 -ip route replace 128.0.0.0/1 via $5 table 42 -/etc/openvpn/update-dnsmasq-forward -exit 0'; + ensure => file, + mode => '0755', + source => "puppet:///modules/ff_gw/etc/openvpn/${provider}/${provider}-up"; "/etc/openvpn/${provider}.conf": ensure => file, source => "puppet:///modules/ff_gw/etc/openvpn/${provider}.conf";