From 12814b8e9d69b507a61dfe5cc3d3b56049f150e1 Mon Sep 17 00:00:00 2001 From: mh Date: Fri, 18 Apr 2014 11:09:58 +0200 Subject: [PATCH] address puppet 3.x deprecation warnings --- templates/host.erb | 6 +++--- templates/tinc-down.erb | 2 +- templates/tinc-up.erb | 18 +++++++++--------- templates/tinc.conf.erb | 8 ++++---- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/templates/host.erb b/templates/host.erb index 5f63c9a..b438c82 100644 --- a/templates/host.erb +++ b/templates/host.erb @@ -1,6 +1,6 @@ Address = <%= scope.lookupvar("::ipaddress_#{tinc_interface.gsub('.','_')}") %> -Port = <%= port %> -Compression = <%= compression %> # 0=no,11=best lzo +Port = <%= @port %> +Compression = <%= @compression %> # 0=no,11=best lzo # -<%= tinc_keys[1] %> +<%= @tinc_keys[1] %> diff --git a/templates/tinc-down.erb b/templates/tinc-down.erb index 78952a6..e1d6e1f 100644 --- a/templates/tinc-down.erb +++ b/templates/tinc-down.erb @@ -1,4 +1,4 @@ #!/bin/sh -brctl delif <%= real_tinc_bridge_interface %> $INTERFACE +brctl delif <%= @real_tinc_bridge_interface %> $INTERFACE diff --git a/templates/tinc-up.erb b/templates/tinc-up.erb index c803ee7..8abaded 100644 --- a/templates/tinc-up.erb +++ b/templates/tinc-up.erb @@ -1,17 +1,17 @@ #!/bin/sh -grep <%= real_tinc_bridge_interface %> /proc/net/dev | awk -F: '{ print $1 }' | grep -q <%= real_tinc_bridge_interface %> +grep <%= @real_tinc_bridge_interface %> /proc/net/dev | awk -F: '{ print $1 }' | grep -q <%= @real_tinc_bridge_interface %> if [ $? -gt 0 ]; then - brctl addbr <%= real_tinc_bridge_interface %> - ifconfig <%= tinc_internal_interface %> 0.0.0.0 - ifconfig <%= real_tinc_bridge_interface %> <%= real_tinc_internal_ip %> netmask 255.255.255.0 - brctl addif <%= real_tinc_bridge_interface %> <%= tinc_internal_interface %> - ifconfig <%= tinc_internal_interface %> up + brctl addbr <%= @real_tinc_bridge_interface %> + ifconfig <%= @tinc_internal_interface %> 0.0.0.0 + ifconfig <%= @real_tinc_bridge_interface %> <%= @real_tinc_internal_ip %> netmask 255.255.255.0 + brctl addif <%= @real_tinc_bridge_interface %> <%= @tinc_internal_interface %> + ifconfig <%= @tinc_internal_interface %> up fi ifconfig $INTERFACE 0.0.0.0 -brctl addif <%= real_tinc_bridge_interface %> $INTERFACE +brctl addif <%= @real_tinc_bridge_interface %> $INTERFACE ifconfig $INTERFACE up -<% if override_mtu -%> -ifconfig $INTERFACE mtu <%= override_mtu.to_i %> +<% if @override_mtu -%> +ifconfig $INTERFACE mtu <%= @override_mtu.to_i %> <% end -%> diff --git a/templates/tinc.conf.erb b/templates/tinc.conf.erb index eaaacbe..010d291 100644 --- a/templates/tinc.conf.erb +++ b/templates/tinc.conf.erb @@ -1,12 +1,12 @@ -Name = <%= fqdn_tinc %> +Name = <%= @fqdn_tinc %> AddressFamily = ipv4 Device = /dev/net/tun #PMTU = 1440 Mode = switch #Mode = router -BindToInterface = <%= tinc_interface.to_s %> +BindToInterface = <%= @tinc_interface.to_s %> -<% tinc_hosts.to_a.reject{|h| h.to_s == scope.lookupvar('::fqdn') }.each do |connect_to_host| -%> +<% Array(@tinc_hosts).reject{|h| h.to_s == scope.lookupvar('::fqdn') }.each do |connect_to_host| -%> ConnectTo = <%= connect_to_host %> -<% end -%> \ No newline at end of file +<% end -%>