4019e266508b0ebc6b896755a4ffe2a6902bb3a6
[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
33         @@concat::fragment { "onion::balance::onionbalance-services.yaml":
34                 target  => "/srv/puppet.debian.org/puppet-facts/onionbalance-services.yaml",
35                 content => $onion_balance_service_hostname,
36                 tag     => "onionbalance-services.yaml",
37         }
38 }