summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--manifests/base.pp5
-rw-r--r--manifests/init.pp9
2 files changed, 11 insertions, 3 deletions
diff --git a/manifests/base.pp b/manifests/base.pp
index 9f0a38e..9544102 100644
--- a/manifests/base.pp
+++ b/manifests/base.pp
@@ -20,6 +20,7 @@ class strongswan::base {
mode => '0400',
}
+ $binary_name = basename($strongswan::binary)
file{
'/etc/ipsec.secrets':
content => ": RSA ${::fqdn}.pem\n";
@@ -34,6 +35,10 @@ class strongswan::base {
ensure => 'present';
'/etc/ipsec.conf':
content => template('strongswan/ipsec.conf.erb');
+ "/usr/local/sbin/${binary_name}_connected_hosts":
+ content => "#!/bin/bash\n${strongswan::binary} status | grep ESTABLISHED | awk -F\[ '{ print \$1 }'\n",
+ notify => undef,
+ mode => '0500';
}
service{'ipsec':
diff --git a/manifests/init.pp b/manifests/init.pp
index 2767783..f2b3bd3 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -19,7 +19,8 @@ class strongswan(
case $::lsbmajdistrelease {
'5': {
$config_dir = '/etc/ipsec.d'
- $cert_dir = '/etc/ipsec.d'
+ $cert_dir = '/etc/ipsec.d'
+ $binary = '/usr/sbin/ipsec'
class{'strongswan::centos::five':
require => Class['monkeysphere'],
@@ -27,7 +28,8 @@ class strongswan(
}
default: {
$config_dir = '/etc/strongswan'
- $cert_dir = '/etc/strongswan/ipsec.d'
+ $cert_dir = '/etc/strongswan/ipsec.d'
+ $binary = '/usr/sbin/strongswan'
class{'strongswan::centos::six':
require => Class['monkeysphere'],
}
@@ -36,7 +38,8 @@ class strongswan(
}
default: {
$config_dir = '/etc/ipsec.d'
- $cert_dir = '/etc/ipsec.d'
+ $cert_dir = '/etc/ipsec.d'
+ $binary = '/usr/sbin/ipsec'
class{'strongswan::base':
require => Class['monkeysphere'],
}