summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvarac <varacanero@zeromail.org>2013-08-10 20:20:13 +0200
committervarac <varacanero@zeromail.org>2013-08-10 20:20:13 +0200
commit3ee1d666927fcb440b8ef22d35246a175277c605 (patch)
tree89c37f4479ba5167668e15d3434cdabf87042385
parentf1da3f6ffe640f45ab74521f55389af504375b74 (diff)
fix variable scope for $custom_hostname
-rw-r--r--manifests/base.pp10
-rw-r--r--manifests/init.pp2
-rw-r--r--templates/ipsec.conf.erb4
-rw-r--r--templates/remote_host.erb2
4 files changed, 9 insertions, 9 deletions
diff --git a/manifests/base.pp b/manifests/base.pp
index ba17118..d02ed57 100644
--- a/manifests/base.pp
+++ b/manifests/base.pp
@@ -6,8 +6,8 @@ class strongswan::base {
} ->
exec { 'ipsec_privatekey':
- command => "certtool --generate-privkey --bits 2048 --outfile ${strongswan::cert_dir}/private/${custom_hostname}.pem",
- creates => "${strongswan::cert_dir}/private/${custom_hostname}.pem";
+ command => "certtool --generate-privkey --bits 2048 --outfile ${strongswan::cert_dir}/private/${strongswan::custom_hostname}.pem",
+ creates => "${strongswan::cert_dir}/private/${strongswan::custom_hostname}.pem";
} ->
anchor{'strongswan::certs::done': }
@@ -19,8 +19,8 @@ class strongswan::base {
}
exec { 'ipsec_monkeysphere_cert':
- command => "monkeysphere-host import-key ${strongswan::cert_dir}/private/${custom_hostname}.pem ike://${custom_hostname} && gpg --homedir /var/lib/monkeysphere/host -a --export =ike://${custom_hostname} > ${strongswan::cert_dir}/certs/${custom_hostname}.asc",
- creates => "${strongswan::cert_dir}/certs/${custom_hostname}.asc",
+ command => "monkeysphere-host import-key ${strongswan::cert_dir}/private/${strongswan::custom_hostname}.pem ike://${strongswan::custom_hostname} && gpg --homedir /var/lib/monkeysphere/host -a --export =ike://${strongswan::custom_hostname} > ${strongswan::cert_dir}/certs/${strongswan::custom_hostname}.asc",
+ creates => "${strongswan::cert_dir}/certs/${strongswan::custom_hostname}.asc",
require => Exec['ipsec_privatekey'],
before => Anchor['strongswan::certs::done'],
}
@@ -37,7 +37,7 @@ class strongswan::base {
$binary_name = basename($strongswan::binary)
file{
'/etc/ipsec.secrets':
- content => ": RSA ${custom_hostname}.pem\n";
+ content => ": RSA ${strongswan::custom_hostname}.pem\n";
# this is needed because if the glob-include in the config
# doesn't find anything it fails.
"${strongswan::config_dir}/hosts":
diff --git a/manifests/init.pp b/manifests/init.pp
index d47bbc0..53e84bb 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -58,7 +58,7 @@ class strongswan(
if $auto_remote_host and ($::strongswan_cert != 'false') and ($::strongswan_cert != '') {
# export myself
- @@strongswan::remote_host { $custom_hostname:
+ @@strongswan::remote_host { $strongswan::custom_hostname:
right_cert_content => $::strongswan_cert,
right_ip_address => $strongswan::default_left_ip_address,
right_subnet => $strongswan::default_left_subnet,
diff --git a/templates/ipsec.conf.erb b/templates/ipsec.conf.erb
index c61b765..6912c16 100644
--- a/templates/ipsec.conf.erb
+++ b/templates/ipsec.conf.erb
@@ -13,8 +13,8 @@ conn %default
rightsendcert=never
leftsendcert=never
left=<%= scope.lookupvar('strongswan::default_left_ip_address') %>
- leftcert=<%= scope.lookupvar('custom_hostname') %>.asc
- leftid=@<%= scope.lookupvar('custom_hostname') %>
+ leftcert=<%= scope.lookupvar('strongswan::custom_hostname') %>.asc
+ leftid=@<%= scope.lookupvar('strongswan::custom_hostname') %>
<% unless (subn=scope.lookupvar('strongswan::default_left_subnet')).empty? -%>
leftsubnet=<%= subn.collect{|s| s.include?('/') ? s : (s.include?(':') ? "#{s}/128" : "#{s}/32" ) }.join(',') %>
<% end -%>
diff --git a/templates/remote_host.erb b/templates/remote_host.erb
index 2c70a37..207e25b 100644
--- a/templates/remote_host.erb
+++ b/templates/remote_host.erb
@@ -1,5 +1,5 @@
# host <%= name %>
-<% if !(right_id =~ /#{scope.lookupvar('custom_hostname')}/) -%>
+<% if !(right_id =~ /#{scope.lookupvar('strongswan::custom_hostname')}/) -%>
conn <%= name %>
<% if left_ip_address != 'absent' -%>
left=<%= left_ip_address %>