aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMicah Anderson <micah@riseup.net>2012-07-30 22:08:30 -0400
committerMicah Anderson <micah@riseup.net>2012-07-30 22:08:53 -0400
commit0cc4d9c90911b0117cfd13fbee5e18bcfd9c89c3 (patch)
treeb28d7dea031a3cfb4fc3c1729eb81acec196f61d
parent7bf57976706f73881d18bbaea0e7f87b7f1c3b40 (diff)
downloadpuppet-tor-0cc4d9c90911b0117cfd13fbee5e18bcfd9c89c3.tar.gz
puppet-tor-0cc4d9c90911b0117cfd13fbee5e18bcfd9c89c3.tar.bz2
switch bandwidth_rate and bandwidth_burst to be relay_bandwidth_rate and
relay_bandwidth_burst so we can use those variables for their proper tor configuration variables
-rw-r--r--manifests/daemon.pp8
-rw-r--r--templates/torrc.relay.erb14
2 files changed, 15 insertions, 7 deletions
diff --git a/manifests/daemon.pp b/manifests/daemon.pp
index 6d8c315..5150c96 100644
--- a/manifests/daemon.pp
+++ b/manifests/daemon.pp
@@ -101,9 +101,11 @@ class tor::daemon inherits tor {
define relay( $port = 0,
$listen_addresses = [],
$outbound_bindaddresses = $listen_addresses,
- $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.
+ $bandwidth_rate = '', # KB/s, defaulting to using tor's default: 5120KB/s
+ $bandwidth_burst = '', # KB/s, defaulting to using tor's default: 10240KB/s
+ $relay_bandwidth_rate = 0, # KB/s, 0 for no limit.
+ $relay_bandwidth_burst = 0, # KB/s, 0 for no limit.
+ $accounting_max = 0, # GB, 0 for no limit.
$accounting_start = [],
$contact_info = '',
$my_family = '', # TODO: autofill with other relays
diff --git a/templates/torrc.relay.erb b/templates/torrc.relay.erb
index 2ab34bf..71c94b9 100644
--- a/templates/torrc.relay.erb
+++ b/templates/torrc.relay.erb
@@ -13,11 +13,17 @@ Nickname <%= nickname %>
<%- if address != '' then -%>
Address <%= address %>
<%- end -%>
-<%- if bandwidth_rate != '0' then -%>
-RelayBandwidthRate <%= bandwidth_rate %> KB
+<%- if bandwidth_rate != '' then -%>
+BandwidthRate <%= bandwidth_rate %> KB
<%- end -%>
-<%- if bandwidth_burst != '0' then -%>
-RelayBandwidthBurst <%= bandwidth_burst %> KB
+<%- if bandwidth_burst != '' then -%>
+BandwidthBurst <%= bandwidth_burst %> KB
+<%- end -%>
+<%- if relay_bandwidth_rate != '0' then -%>
+RelayBandwidthRate <%= relay_bandwidth_rate %> KB
+<%- end -%>
+<%- if relay_bandwidth_burst != '0' then -%>
+RelayBandwidthBurst <%= relay_bandwidth_burst %> KB
<%- end -%>
<%- if accounting_max != '0' then -%>
AccountingMax <%= accounting_max %> GB