summaryrefslogtreecommitdiff
path: root/puppet/modules/site_tor/manifests/init.pp
blob: 654337c70094fd8cff9e186abc1c5304cd2c11b2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
class site_tor {
  tag 'leap_service'

  $tor = hiera('tor')
  $bandwidth_rate = $tor['bandwidth_rate']
  $tor_type = $tor['type']

  $contact_email = hiera('contact_email')
  $address       = hiera('ip_address')

  class { 'tor::daemon': }
  tor::daemon::relay { $::hostname:
    port             => 9001,
    address          => $address,
    contact_info     => $contact_email,
    bandwidth_rate   => $bandwidth_rate,
  }

  tor::daemon::directory { $::hostname: port => 80 }

  include site_shorewall::tor

  if ( $tor_type != 'exit' ) {
    include site_tor::disable_exit
  }

}