aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--manifests/daemon.pp14
-rw-r--r--templates/torrc.dns.erb5
2 files changed, 19 insertions, 0 deletions
diff --git a/manifests/daemon.pp b/manifests/daemon.pp
index 4911cd0..ac8529c 100644
--- a/manifests/daemon.pp
+++ b/manifests/daemon.pp
@@ -190,5 +190,19 @@ class tor::daemon inherits tor {
ensure => $ensure,
}
}
+
+ # DNS definition
+ define dns( $port = 0,
+ $listen_addresses = [],
+ $ensure = present ) {
+
+ concatenated_file_part { "08.dns.${name}":
+ dir => $tor::daemon::snippet_dir,
+ content => template('tor/torrc.dns.erb'),
+ owner => 'debian-tor', group => 'debian-tor', mode => 0644,
+ ensure => $ensure,
+ }
+ }
+
}
diff --git a/templates/torrc.dns.erb b/templates/torrc.dns.erb
new file mode 100644
index 0000000..bd1e719
--- /dev/null
+++ b/templates/torrc.dns.erb
@@ -0,0 +1,5 @@
+# DNS
+DNSPort <%= port %>
+<%- for listen_address in listen_addresses -%>
+DNSListenAddress <%= listen_address %>
+<%- end -%>