summaryrefslogtreecommitdiff
path: root/manifests/daemon.pp
diff options
context:
space:
mode:
authorintrigeri <intrigeri@boum.org>2012-04-26 16:56:35 +0200
committerintrigeri <intrigeri@boum.org>2012-04-26 17:21:48 +0200
commit8e0dbb0d9d903fbf89e4263cd29c1b1a7d597075 (patch)
tree848034bc3ea87ec7058690c2396007ac13163a0c /manifests/daemon.pp
parent7bf57976706f73881d18bbaea0e7f87b7f1c3b40 (diff)
Fix the relay define's outbound_bindaddresses default value setting.
Apparently, we have no guarantee $outbound_bindaddresses's value is set *after* $listen_addresses is, so (at least on my setup) it ends up being undef, and then the template parsing fails: err: Could not retrieve catalog from remote server: Error 400 on SERVER: Failed to parse template tor/torrc.relay.erb: undefined method `each' for :undef:Symbol at /etc/puppet/modules/tor/manifests/daemon.pp:117 So, let's set $real_outbound_bindaddresses to $listen_addresses in the define body, as needed.
Diffstat (limited to 'manifests/daemon.pp')
-rw-r--r--manifests/daemon.pp8
1 files changed, 7 insertions, 1 deletions
diff --git a/manifests/daemon.pp b/manifests/daemon.pp
index 6d8c315..dddef14 100644
--- a/manifests/daemon.pp
+++ b/manifests/daemon.pp
@@ -100,7 +100,7 @@ class tor::daemon inherits tor {
# relay definition
define relay( $port = 0,
$listen_addresses = [],
- $outbound_bindaddresses = $listen_addresses,
+ $outbound_bindaddresses = [],
$bandwidth_rate = 0, # KB/s, 0 for no limit.
$bandwidth_burst = 0, # KB/s, 0 for no limit.
$accounting_max = 0, # GB, 0 for no limit.
@@ -112,6 +112,12 @@ class tor::daemon inherits tor {
$ensure = present ) {
$nickname = $name
+ if $outbound_bindaddresses == [] {
+ $real_outbound_bindaddresses = $listen_addresses
+ } else {
+ $real_outbound_bindaddresses = $outbound_bindaddresses
+ }
+
concatenated_file_part { '03.relay':
dir => $tor::daemon::snippet_dir,
content => template('tor/torrc.relay.erb'),