2d72573836c33113404c3f0003ae6092fb7b95ef
[mirror/dsa-puppet.git] / modules / onion / manifests / balance.pp
1 class onion::balance {
2         include onion
3
4         package { 'onionbalance':
5                 ensure => installed,
6         }
7         service { 'onionbalance':
8                 ensure => running,
9                 require => Package['onionbalance'],
10         }
11
12         file { '/usr/local/bin/tor-onion-name':
13                 mode    => '0555',
14                 source  => 'puppet:///modules/onion/tor-onion-name',
15         }
16
17         concat::fragment { 'onion::torrc_control_header':
18                 target  => "/etc/tor/torrc",
19                 order   => 10,
20                 content => "ControlPort 9051\n\n",
21         }
22
23         concat { '/etc/onionbalance/config.yaml':
24                 notify  => Service['onionbalance'],
25                 require => Package['onionbalance'],
26         }
27         concat::fragment { 'onion::balance::config_header':
28                 target  => "/etc/onionbalance/config.yaml",
29                 order   => 05,
30                 content => "services:\n",
31         }
32 }