From bd6b6a2e6c0d3a09127d8b6a342195d6f924de44 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Thu, 3 Nov 2016 11:58:57 +0000 Subject: Update template to really honor tor::daemon's safe_logging parameter. Without this change, using tor::daemon with the default safe_logging parameter results in a "SafeLogging 1" line being added to torrc, which is obviously not the intent of this piece of code. Also, this change makes parameters lookup consistent with how it's done everywhere else in this ERB template. --- templates/torrc.global.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'templates/torrc.global.erb') diff --git a/templates/torrc.global.erb b/templates/torrc.global.erb index f577673..a02afc8 100644 --- a/templates/torrc.global.erb +++ b/templates/torrc.global.erb @@ -12,8 +12,8 @@ Log notice syslog Log <%= log_rule %> <% end -%> <% end -%> -<%- if @safe_logging != 1 then -%> -SafeLogging <%= @safe_logging %> +<%- if (v=scope.lookupvar('tor::daemon::safe_logging')) != '1' then -%> +SafeLogging <%= v %> <%- end -%> <% if (v=scope.lookupvar('tor::daemon::automap_hosts_on_resolve')) != '0' -%> -- cgit v1.2.3 From 26f56433a57aec688a18a964751cfe08b62d9bd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Louis-Philippe=20V=C3=A9ronneau?= Date: Wed, 11 Oct 2017 15:35:21 -0400 Subject: puppet 4 needs arrays in templates to be marked as such --- templates/torrc.global.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'templates/torrc.global.erb') diff --git a/templates/torrc.global.erb b/templates/torrc.global.erb index a02afc8..c29b76b 100644 --- a/templates/torrc.global.erb +++ b/templates/torrc.global.erb @@ -8,7 +8,7 @@ DataDirectory <%= v %> <% if (rules=scope.lookupvar('tor::daemon::log_rules')).empty? -%> Log notice syslog <% else -%> -<% rules.each do |log_rule| -%> +<% Array(rules).each do |log_rule| -%> Log <%= log_rule %> <% end -%> <% end -%> -- cgit v1.2.3