Compare commits
No commits in common. "4e80b272f602cb9fb5674b26041a9a992222df97" and "57b93c08831560b7be7bf0f9013f1045352de7f5" have entirely different histories.
4e80b272f6
...
57b93c0883
3 changed files with 11 additions and 26 deletions
|
@ -4,12 +4,9 @@ define tinc::instance(
|
||||||
$connect_on_boot = true,
|
$connect_on_boot = true,
|
||||||
$tinc_interface = 'eth0',
|
$tinc_interface = 'eth0',
|
||||||
$tinc_address = undef,
|
$tinc_address = undef,
|
||||||
$tinc_address_to_export = undef,
|
|
||||||
$port = '655',
|
$port = '655',
|
||||||
$port_to_export = '655',
|
|
||||||
$compression = '10',
|
$compression = '10',
|
||||||
$mode = 'switch',
|
$mode = 'switch',
|
||||||
$options = {},
|
|
||||||
$tinc_up_content = undef,
|
$tinc_up_content = undef,
|
||||||
$tinc_down_content = undef,
|
$tinc_down_content = undef,
|
||||||
){
|
){
|
||||||
|
@ -97,11 +94,6 @@ define tinc::instance(
|
||||||
$int_name_escaped = regsubst($tinc_interface,'\.','_','G')
|
$int_name_escaped = regsubst($tinc_interface,'\.','_','G')
|
||||||
$host_address = getvar("::ipaddress_${int_name_escaped}")
|
$host_address = getvar("::ipaddress_${int_name_escaped}")
|
||||||
}
|
}
|
||||||
if $tinc_address_to_export {
|
|
||||||
$export_addr = $tinc_address_to_export
|
|
||||||
} else {
|
|
||||||
$export_addr = $host_address
|
|
||||||
}
|
|
||||||
|
|
||||||
# get the keys
|
# get the keys
|
||||||
# [ priv, pub ]
|
# [ priv, pub ]
|
||||||
|
@ -122,9 +114,9 @@ define tinc::instance(
|
||||||
}
|
}
|
||||||
# export this host and collect all the other hosts
|
# export this host and collect all the other hosts
|
||||||
@@tinc::host{"${fqdn_tinc}@${name}":
|
@@tinc::host{"${fqdn_tinc}@${name}":
|
||||||
port => $port_to_export,
|
port => $port,
|
||||||
compression => $compression,
|
compression => $compression,
|
||||||
address => $export_addr,
|
address => $host_address,
|
||||||
public_key => $tinc_keys[1],
|
public_key => $tinc_keys[1],
|
||||||
tag => "tinc::host_for_${name}",
|
tag => "tinc::host_for_${name}",
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,14 +5,11 @@ define tinc::switch(
|
||||||
$tinc_interface = 'eth0',
|
$tinc_interface = 'eth0',
|
||||||
$tinc_address = undef,
|
$tinc_address = undef,
|
||||||
$port = '655',
|
$port = '655',
|
||||||
$tinc_address_to_export = undef,
|
|
||||||
$port_to_export = '655',
|
|
||||||
$tinc_internal_interface = 'eth1',
|
$tinc_internal_interface = 'eth1',
|
||||||
$tinc_internal_ip = 'absent',
|
$tinc_internal_ip = 'absent',
|
||||||
$tinc_internal_netmask = 'absent',
|
$tinc_internal_netmask = 'absent',
|
||||||
$tinc_bridge_interface = 'absent',
|
$tinc_bridge_interface = 'absent',
|
||||||
$compression = '10',
|
$compression = '10',
|
||||||
$options = {},
|
|
||||||
$shorewall_zone = 'absent'
|
$shorewall_zone = 'absent'
|
||||||
){
|
){
|
||||||
|
|
||||||
|
@ -21,12 +18,9 @@ define tinc::switch(
|
||||||
connect_on_boot => $connect_on_boot,
|
connect_on_boot => $connect_on_boot,
|
||||||
tinc_interface => $tinc_interface,
|
tinc_interface => $tinc_interface,
|
||||||
tinc_address => $tinc_address,
|
tinc_address => $tinc_address,
|
||||||
tinc_address_to_export => $tinc_address_to_export,
|
|
||||||
port => $port,
|
port => $port,
|
||||||
port_to_export => $port_to_export,
|
|
||||||
compression => $compression,
|
compression => $compression,
|
||||||
mode => 'switch',
|
mode => 'switch',
|
||||||
options => $options,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if $ensure == 'present' {
|
if $ensure == 'present' {
|
||||||
|
|
|
@ -1,10 +1,9 @@
|
||||||
Name = <%= @fqdn_tinc %>
|
Name = <%= @fqdn_tinc %>
|
||||||
AddressFamily = ipv4
|
AddressFamily = ipv4
|
||||||
Device = /dev/net/tun
|
Device = /dev/net/tun
|
||||||
|
#PMTU = 1440
|
||||||
Mode = <%= @mode %>
|
Mode = <%= @mode %>
|
||||||
|
|
||||||
BindToAddress = <%= @host_address %> <%= @port %>
|
BindToAddress = <%= @host_address %> <%= @port %>
|
||||||
BindToInterface = <%= @tinc_interface.to_s %>
|
BindToInterface = <%= @tinc_interface.to_s %>
|
||||||
<% @options.keys.sort.each do |key| -%>
|
|
||||||
<%= key %> = <%= @options[key] %>
|
|
||||||
<% end -%>
|
|
||||||
|
|
Loading…
Reference in a new issue