From c4e969365e79e8b7397acfd8cfc716190c092531 Mon Sep 17 00:00:00 2001 From: mh Date: Wed, 1 Sep 2010 10:52:35 +0200 Subject: [PATCH] fix variable in templates puppet variables aren't variables in templates. Therefore has_variable? is not working as expected. --- manifests/vpn/conf.pp | 2 +- templates/tinc.conf.erb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/manifests/vpn/conf.pp b/manifests/vpn/conf.pp index d04de7c..b8d25c5 100644 --- a/manifests/vpn/conf.pp +++ b/manifests/vpn/conf.pp @@ -1,7 +1,7 @@ # $name => Name of network=ring define tinc::vpn::conf ( $ensure = present, - $connectTo = '', + $connectTo = 'absent', ){ file { "/etc/tinc/${name}/tinc.conf": diff --git a/templates/tinc.conf.erb b/templates/tinc.conf.erb index cc07290..9ea01bc 100644 --- a/templates/tinc.conf.erb +++ b/templates/tinc.conf.erb @@ -5,8 +5,8 @@ Device = /dev/net/tun Mode = switch #Mode = router -<% if has_variable?(connectTo) -%> -ConnectTo = <%= connectTo %> +<% unless connect_to.to_s == 'absent' -%> +ConnectTo = <%= connect_to %> <% end -%> #GraphDumpFile = /tmp/tincdump