From 3ee1d666927fcb440b8ef22d35246a175277c605 Mon Sep 17 00:00:00 2001 From: varac Date: Sat, 10 Aug 2013 20:20:13 +0200 Subject: fix variable scope for $custom_hostname --- manifests/base.pp | 10 +++++----- manifests/init.pp | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'manifests') 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, -- cgit v1.2.3