aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorintrigeri <intrigeri@boum.org>2012-06-19 04:07:31 +0200
committerintrigeri <intrigeri@boum.org>2012-06-19 05:22:47 +0200
commitf401daa245495233c3d86d5f955105be564e02b1 (patch)
treed04e6137456d2b44e3eadaa055e24515aadbaf7c
parentebee9da1b3883461b18f9aae86663002195e94e7 (diff)
downloadpuppet-tor-f401daa245495233c3d86d5f955105be564e02b1.tar.gz
puppet-tor-f401daa245495233c3d86d5f955105be564e02b1.tar.bz2
Add support for using bridges.
-rw-r--r--manifests/daemon.pp17
-rw-r--r--templates/torrc.bridge.erb3
-rw-r--r--templates/torrc.global.erb1
3 files changed, 20 insertions, 1 deletions
diff --git a/manifests/daemon.pp b/manifests/daemon.pp
index 0778bce..2484edf 100644
--- a/manifests/daemon.pp
+++ b/manifests/daemon.pp
@@ -76,7 +76,8 @@ class tor::daemon inherits tor {
# global configurations
define global_opts( $data_dir = $tor::daemon::data_dir,
- $log_rules = [ 'notice file /var/log/tor/notices.log' ] ) {
+ $log_rules = [ 'notice file /var/log/tor/notices.log' ],
+ $use_bridges = 0 ) {
concatenated_file_part { '01.global':
dir => $tor::daemon::snippet_dir,
@@ -217,5 +218,19 @@ class tor::daemon inherits tor {
}
}
+ # Bridge definition
+ define bridge( $ip,
+ $port,
+ $fingerprint = false,
+ $ensure = present ) {
+
+ concatenated_file_part { "10.bridge.${name}":
+ dir => $tor::daemon::snippet_dir,
+ content => template('tor/torrc.bridge.erb'),
+ owner => 'debian-tor', group => 'debian-tor', mode => 0644,
+ ensure => $ensure,
+ }
+ }
+
}
diff --git a/templates/torrc.bridge.erb b/templates/torrc.bridge.erb
new file mode 100644
index 0000000..58ef70d
--- /dev/null
+++ b/templates/torrc.bridge.erb
@@ -0,0 +1,3 @@
+# Bridge <%= name%>
+Bridge <%= ip%>:<%= port%><%- if fingerprint -%> <%= fingerprint%><%- end -%>
+
diff --git a/templates/torrc.global.erb b/templates/torrc.global.erb
index 6ca49de..84e244d 100644
--- a/templates/torrc.global.erb
+++ b/templates/torrc.global.erb
@@ -11,3 +11,4 @@ Log <%= log_rule %>
Log notice syslog
<%- end -%>
+UseBridges <%= use_bridges%>