summaryrefslogtreecommitdiff
path: root/puppet/modules/site_config
diff options
context:
space:
mode:
authorvarac <varacanero@zeromail.org>2012-10-29 14:53:06 +0100
committervarac <varacanero@zeromail.org>2012-10-29 14:53:06 +0100
commitc40a1bce442aab4ba8baf062ffcb65e006ad13e0 (patch)
treeeab5636c43fb9c15d2f8ccf663e839d91e1803ac /puppet/modules/site_config
parent8253e3ebeb88ba33131365a1b584878a12bbd225 (diff)
use script to add second ip
Diffstat (limited to 'puppet/modules/site_config')
-rw-r--r--puppet/modules/site_config/manifests/eip.pp47
1 files changed, 31 insertions, 16 deletions
diff --git a/puppet/modules/site_config/manifests/eip.pp b/puppet/modules/site_config/manifests/eip.pp
index 1beea9ce..c81ad33a 100644
--- a/puppet/modules/site_config/manifests/eip.pp
+++ b/puppet/modules/site_config/manifests/eip.pp
@@ -18,29 +18,44 @@ class site_config::eip {
options => [ "address $ip_address",
'netmask 255.255.255.0',
"gateway $gateway_address",
- "up ip addr add $openvpn_gateway_address/24 dev eth0",
- "down ip addr del $openvpn_gateway_address/24 dev eth0",
+ "up ip addr add $openvpn_gateway_address/24 dev $interface",
+ "down ip addr del $openvpn_gateway_address/24 dev $interface",
],
auto => 1,
allow_hotplug => 1 }
- site_openvpn::server_config { 'tcp_config':
- port => '1194',
- proto => 'tcp',
- local => $gateway_address,
- server => '10.1.0.0 255.255.248.0',
- push => '"dhcp-option DNS 10.1.0.1"',
- management => '127.0.0.1 1000'
+ #site_openvpn::server_config { 'tcp_config':
+ # port => '1194',
+ # proto => 'tcp',
+ # local => $gateway_address,
+ # server => '10.1.0.0 255.255.248.0',
+ # push => '"dhcp-option DNS 10.1.0.1"',
+ # management => '127.0.0.1 1000'
+ #}
+ #site_openvpn::server_config { 'udp_config':
+ # port => '1194',
+ # proto => 'udp',
+ # local => $gateway_address,
+ # server => '10.2.0.0 255.255.248.0',
+ # push => '"dhcp-option DNS 10.2.0.1"',
+ # management => '127.0.0.1 1001'
+ #}
+
+ file { '/usr/local/bin/leap_add_second_ip.sh':
+ content => '#!/bin/sh
+ ip addr show dev eth0 | grep -q "$openvpn_gateway_address/24" || ip addr add "$openvpn_gateway_address/24" dev eth0',
+ mode => '0755',
}
- site_openvpn::server_config { 'udp_config':
- port => '1194',
- proto => 'udp',
- local => $gateway_address,
- server => '10.2.0.0 255.255.248.0',
- push => '"dhcp-option DNS 10.2.0.1"',
- management => '127.0.0.1 1001'
+
+ exec { '/usr/local/bin/leap_add_second_ip.sh':
+ subscribe => File['/usr/local/bin/leap_add_second_ip.sh'],
}
+ #exec { "ip addr add $openvpn_gateway_address/24 dev $interface":
+ # path => '/usr/bin:/sbin',
+ # unless => "ip addr show dev $interface | grep -q '$interface/24'"
+ #}
+
include site_shorewall::eip
}