fix variable in templates
puppet variables aren't variables in templates. Therefore has_variable? is not working as expected.
This commit is contained in:
parent
7cc28431b5
commit
c4e969365e
2 changed files with 3 additions and 3 deletions
|
@ -1,7 +1,7 @@
|
||||||
# $name => Name of network=ring
|
# $name => Name of network=ring
|
||||||
define tinc::vpn::conf (
|
define tinc::vpn::conf (
|
||||||
$ensure = present,
|
$ensure = present,
|
||||||
$connectTo = '',
|
$connectTo = 'absent',
|
||||||
){
|
){
|
||||||
|
|
||||||
file { "/etc/tinc/${name}/tinc.conf":
|
file { "/etc/tinc/${name}/tinc.conf":
|
||||||
|
|
|
@ -5,8 +5,8 @@ Device = /dev/net/tun
|
||||||
Mode = switch
|
Mode = switch
|
||||||
#Mode = router
|
#Mode = router
|
||||||
|
|
||||||
<% if has_variable?(connectTo) -%>
|
<% unless connect_to.to_s == 'absent' -%>
|
||||||
ConnectTo = <%= connectTo %>
|
ConnectTo = <%= connect_to %>
|
||||||
<% end -%>
|
<% end -%>
|
||||||
|
|
||||||
#GraphDumpFile = /tmp/tincdump
|
#GraphDumpFile = /tmp/tincdump
|
||||||
|
|
Loading…
Reference in a new issue