Start an onion module
[mirror/dsa-puppet.git] / modules / onion / manifests / service.pp
diff --git a/modules/onion/manifests/service.pp b/modules/onion/manifests/service.pp
new file mode 100644 (file)
index 0000000..1bfdb8d
--- /dev/null
@@ -0,0 +1,13 @@
+define onion::service (
+       $port,
+       $target_address,
+       $target_port
+) {
+       include onion
+
+       concat::fragment { "onion::torrc_onionservice::${name}":
+               target  => "/etc/tor/torrc",
+               order   => 10,
+               content => "HiddenServiceDir /var/lib/tor/onion/${name}\nHiddenServicePort ${port} ${target_address}:${target_port}\n\n",
+       }
+}