1 define onion::service (
8 if ($ensure == "ifstatic") {
9 $my_ensure = has_static_component($name) ? {
17 if ($my_ensure == "present") {
20 concat::fragment { "onion::torrc_onionservice::${name}":
21 target => "/etc/tor/torrc",
23 content => "HiddenServiceDir /var/lib/tor/onion/${name}\nHiddenServicePort ${port} ${target_address}:${target_port}\n\n",
26 $onion_hn = onion_tor_service_hostname($name)
28 $hostname_without_onion = regsubst($onion_hn, '\.onion$', '')
29 @@concat::fragment { "onion::balance::instance::$name::$fqdn":
30 target => "/etc/onionbalance/config.yaml",
31 content => " - address: ${hostname_without_onion}\n name: ${hostname}-${name}\n",
32 order => "50-${name}-20",
33 tag => "onion::balance::$name",
37 @@concat::fragment { "onion::balance::onionbalance-services.yaml::${name}":
38 target => "/srv/puppet.torproject.org/puppet-facts/onionbalance-services.yaml",
39 content => "{\"${name}\": \"${onion_hn}\"}\n",
40 tag => "onionbalance-services.yaml",