some more magic to lookup the ip address for the bridged interface

This commit is contained in:
mh 2010-12-29 22:53:40 +01:00
parent 3a8a08dd28
commit e41cf10088

View file

@ -87,8 +87,15 @@ define tinc::vpn_net(
}
if $tinc_internal_ip == 'absent' {
$tinc_orig_ifaddr = "ipaddress_${tinc_internal_interface}"
$real_tinc_internal_ip = inline_template("<%= scope.lookupvar(tinc_orig_ifaddr) %>")
$tinc_br_ifaddr = "ipaddress_${real_tinc_bridge_interface}"
$tinc_br_ip = inline_template("<%= scope.lookupvar(tinc_br_ifaddr) %>")
case $tinc_br_ip {
'',undef: {
$tinc_orig_ifaddr = "ipaddress_${tinc_internal_interface}"
$real_tinc_internal_ip = inline_template("<%= scope.lookupvar(tinc_orig_ifaddr) %>")
}
default: { $real_tinc_internal_ip = $tinc_br_ip }
}
} else {
$real_tinc_internal_ip = $tinc_internal_ip
}