aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorintrigeri <intrigeri@boum.org>2012-06-19 03:59:20 +0200
committerintrigeri <intrigeri@boum.org>2012-06-19 05:22:42 +0200
commitf12bf2ae954aeabb0c75d52801158238931ca0ae (patch)
treed626ef6ef78e77e70f871e790fdba10aa2447cf1
parenta7fa4a80543ea29ec9521831b15b146911c5fe8a (diff)
downloadpuppet-tor-f12bf2ae954aeabb0c75d52801158238931ca0ae.tar.gz
puppet-tor-f12bf2ae954aeabb0c75d52801158238931ca0ae.tar.bz2
Add support for DNSPort and DNSListenAddress.
-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 -%>