relay.pp 1.11 KB
Newer Older
mh's avatar
mh committed
1
2
# relay definition
define tor::daemon::relay(
mh's avatar
mh committed
3
  $ensure                  = 'present',
mh's avatar
mh committed
4
5
  $port                    = 0,
  $outbound_bindaddresses  = [],
6
  $portforwarding          = 0,
mh's avatar
mh committed
7
8
9
10
11
12
13
14
15
16
  # KB/s, defaulting to using tor's default: 5120KB/s
  $bandwidth_rate          = '',
  # KB/s, defaulting to using tor's default: 10240KB/s
  $bandwidth_burst         = '',
  # KB/s, 0 for no limit
  $relay_bandwidth_rate    = 0,
  # KB/s, 0 for no limit
  $relay_bandwidth_burst   = 0,
  # GB, 0 for no limit
  $accounting_max          = 0,
17
  $accounting_start        = 'month 1 0:00',
mh's avatar
mh committed
18
19
20
21
22
  $contact_info            = '',
  # TODO: autofill with other relays
  $my_family               = '',
  $address                 = "tor.${::domain}",
  $bridge_relay            = 0,
mh's avatar
mh committed
23
) {
mh's avatar
mh committed
24

mh's avatar
mh committed
25
26
  if $ensure == 'present' {
    $nickname = $name
mh's avatar
mh committed
27

mh's avatar
mh committed
28
29
30
31
32
    if $outbound_bindaddresses == [] {
      $real_outbound_bindaddresses = []
    } else {
      $real_outbound_bindaddresses = $outbound_bindaddresses
    }
mh's avatar
mh committed
33

mh's avatar
mh committed
34
35
36
37
38
    concat::fragment { '03.relay':
      content => template('tor/torrc.relay.erb'),
      order   => '03',
      target  => $tor::daemon::config_file,
    }
mh's avatar
mh committed
39
40
  }
}