use fqdn in storedconf name
[mirror/dsa-puppet.git] / modules / onion / manifests / service.pp
1 define onion::service (
2         $port,
3         $target_address,
4         $target_port
5 ) {
6         include onion
7
8         concat::fragment { "onion::torrc_onionservice::${name}":
9                 target  => "/etc/tor/torrc",
10                 order   => 50,
11                 content => "HiddenServiceDir /var/lib/tor/onion/${name}\nHiddenServicePort ${port} ${target_address}:${target_port}\n\n",
12         }
13
14         $onion_hn = onion_hostname($name)
15         if $onion_hn {
16                 @@concat::fragment { "onion::balance::instance::$name::$fqdn":
17                         target  => "/etc/onionbalance/config",
18                         content => "      - address: ${onion_hn}\n        name: ${hostname}-${name}\n",
19                         order   => "50-${name}-20",
20                         tag     => "onion::balance::$name",
21                 }
22         }
23 }