summaryrefslogtreecommitdiff
path: root/manifests/monitor.pp
blob: e47b2b607dd8871d29cf18ad685663cb85610baa (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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# Generate the hash using 'tor --hash-password <password>'
class onion::monitor(
  $control_password        = hiera('onion::monitor::control_password'),
  $hashed_control_password = hiera('onion::monitor::hashed_control_password')
) {
  tor::daemon::control{ "control":
    port                    => 9051,
    ensure                  => present,
    hashed_control_password => $hashed_control_password,
  }

  file { '/root/.arm':
    ensure => directory,
    owner  => root,
    group  => root,
    mode   => 0750,
  }

  file { '/var/lib/tor/.arm':
    ensure => directory,
    owner  => debian-tor,
    group  => debian-tor,
    mode   => 0750,
  }

  file { '/root/.arm/armrc':
    ensure  => present,
    owner   => root,
    group   => root,
    mode    => 0640,
    content => template('onion/armrc.erb'),
    require => File['/root/.arm'],
  }

  file { '/var/lib/tor/.arm/armrc':
    ensure  => present,
    owner   => debian-tor,
    group   => debian-tor,
    mode    => 0640,
    content => template('onion/armrc.erb'),
    require => File['/var/lib/tor/.arm'],
  }
}