From 8c936c166b6da1ebd0e8d95e56ceee5167357d63 Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Fri, 11 Mar 2016 12:08:39 -0500 Subject: Fix deprecated variable references --- templates/torrc.relay.erb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/templates/torrc.relay.erb b/templates/torrc.relay.erb index 511bda1..a286459 100644 --- a/templates/torrc.relay.erb +++ b/templates/torrc.relay.erb @@ -1,11 +1,11 @@ # relay <% if @port != 0 -%> ORPort <%= @port %> -<% listen_addresses.each do |listen_address| -%> -ORListenAddress <%= listen_address %> +<% @listen_addresses.each do |listen_address| -%> +ORListenAddress <%= @listen_address %> <% end -%> -<% real_outbound_bindaddresses.each do |outbound_bindaddress| -%> -OutboundBindAddress <%= outbound_bindaddress %> +<% @real_outbound_bindaddresses.each do |outbound_bindaddress| -%> +OutboundBindAddress <%= @outbound_bindaddress %> <% end -%> <% if @nickname != '' -%> Nickname <%= @nickname %> -- cgit v1.2.3 From 43506968b1760b8a54f012c72baa9a5820cee21a Mon Sep 17 00:00:00 2001 From: varac Date: Thu, 28 Apr 2016 14:09:47 +0200 Subject: [style] Quote numbers in resource parameters Puppet future parser won't allow unquoted numbers --- manifests/daemon/dns.pp | 2 +- manifests/daemon/map_address.pp | 4 ++-- manifests/daemon/transparent.pp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/manifests/daemon/dns.pp b/manifests/daemon/dns.pp index f3a7027..4677f24 100644 --- a/manifests/daemon/dns.pp +++ b/manifests/daemon/dns.pp @@ -10,7 +10,7 @@ define tor::daemon::dns( owner => 'debian-tor', group => 'debian-tor', mode => '0644', - order => 08, + order => '08', target => $tor::daemon::config_file, } } diff --git a/manifests/daemon/map_address.pp b/manifests/daemon/map_address.pp index e970fe5..270eac2 100644 --- a/manifests/daemon/map_address.pp +++ b/manifests/daemon/map_address.pp @@ -1,7 +1,7 @@ # map address definition define tor::daemon::map_address( $address = '', - $newaddress = '' + $newaddress = '', $ensure = 'present') { concat::fragment { "08.map_address.${name}": @@ -10,7 +10,7 @@ define tor::daemon::map_address( owner => 'debian-tor', group => 'debian-tor', mode => '0644', - order => 08, + order => '08', target => $tor::daemon::config_file, } } diff --git a/manifests/daemon/transparent.pp b/manifests/daemon/transparent.pp index 74fed4f..65d744f 100644 --- a/manifests/daemon/transparent.pp +++ b/manifests/daemon/transparent.pp @@ -10,7 +10,7 @@ define tor::daemon::transparent( owner => 'debian-tor', group => 'debian-tor', mode => '0644', - order => 09, + order => '09', target => $tor::daemon::config_file, } } -- cgit v1.2.3 From 687dccf2b5b99ea5b4f2fdfb115295ccff9a1c1a Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Tue, 16 Aug 2016 12:13:11 -0400 Subject: Variable access via 'port' is deprecated. Use '@port' instead, in template[/srv/leap/puppet/modules/tor/templates/torrc.directory.erb]:2 --- templates/torrc.directory.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/torrc.directory.erb b/templates/torrc.directory.erb index 1af9f40..c7dc4ab 100644 --- a/templates/torrc.directory.erb +++ b/templates/torrc.directory.erb @@ -1,11 +1,11 @@ # directory listing -<% if port != '0' -%> +<% if @port != '0' -%> DirPort <%= @port %> <% end -%> <% listen_addresses.each do |listen_address| -%> DirListenAddress <%= listen_address %> <% end -%> <% if @port_front_page != '' -%> -DirPortFrontPage <%= port_front_page %> +DirPortFrontPage <%= @port_front_page %> <%- end -%> -- cgit v1.2.3 From 49b67cbc9112fddf49cc12264d2626fd952e0a7c Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Thu, 25 Aug 2016 10:26:40 -0400 Subject: Fixes for puppet lint --- manifests/daemon/base.pp | 6 +++--- manifests/daemon/control.pp | 15 +++++++++------ manifests/munin.pp | 2 +- manifests/repo.pp | 3 ++- manifests/repo/debian.pp | 2 +- 5 files changed, 16 insertions(+), 12 deletions(-) diff --git a/manifests/daemon/base.pp b/manifests/daemon/base.pp index 63d7bc4..c0b1640 100644 --- a/manifests/daemon/base.pp +++ b/manifests/daemon/base.pp @@ -49,9 +49,9 @@ class tor::daemon::base inherits tor::base { # tor configuration file concat { $tor::daemon::config_file: - mode => '0600', - owner => 'debian-tor', - group => 'debian-tor', + mode => '0600', + owner => 'debian-tor', + group => 'debian-tor', } # config file headers diff --git a/manifests/daemon/control.pp b/manifests/daemon/control.pp index 0172656..d19a1db 100644 --- a/manifests/daemon/control.pp +++ b/manifests/daemon/control.pp @@ -7,13 +7,16 @@ define tor::daemon::control( $cookie_auth_file_group_readable = '', $ensure = present ) { - if $cookie_authentication == '0' and $hashed_control_password == '' and $ensure != 'absent' { - fail('You need to define the tor control password') - } + if $cookie_authentication == '0' + and $hashed_control_password == '' + and $ensure != 'absent' { + fail('You need to define the tor control password') + } - if $cookie_authentication == 0 and ($cookie_auth_file != '' or $cookie_auth_file_group_readable != '') { - notice('You set a tor cookie authentication option, but do not have cookie_authentication on') - } + if $cookie_authentication == 0 + and ($cookie_auth_file != '' or $cookie_auth_file_group_readable != '') { + notice('You set a tor cookie authentication option, but do not have cookie_authentication on') # lint:ignore:80chars + } concat::fragment { '04.control': ensure => $ensure, diff --git a/manifests/munin.pp b/manifests/munin.pp index 4412337..2a01175 100644 --- a/manifests/munin.pp +++ b/manifests/munin.pp @@ -8,7 +8,7 @@ class tor::munin { } Munin::Plugin::Deploy { - config => "user debian-tor\n env.cookiefile /var/run/tor/control.authcookie\n env.port 19051" + config => "user debian-tor\n env.cookiefile /var/run/tor/control.authcookie\n env.port 19051" # lint:ignore:80chars } munin::plugin::deploy { 'tor_connections': diff --git a/manifests/repo.pp b/manifests/repo.pp index f625599..9549219 100644 --- a/manifests/repo.pp +++ b/manifests/repo.pp @@ -1,3 +1,4 @@ +# setup repository for tor class tor::repo ( $ensure = present, $source_name = 'torproject.org', @@ -10,7 +11,7 @@ class tor::repo ( class { 'tor::repo::debian': } } default: { - fail("Unsupported managed repository for osfamily: ${::osfamily}, operatingsystem: ${::operatingsystem}, module ${module_name} currently only supports managing repos for osfamily Debian and Ubuntu") + fail("Unsupported managed repository for osfamily: ${::osfamily}, operatingsystem: ${::operatingsystem}, module ${module_name} currently only supports managing repos for osfamily Debian and Ubuntu") # lint:ignore:80chars } } } diff --git a/manifests/repo/debian.pp b/manifests/repo/debian.pp index 174c331..81976a2 100644 --- a/manifests/repo/debian.pp +++ b/manifests/repo/debian.pp @@ -1,6 +1,6 @@ # PRIVATE CLASS: do not use directly class tor::repo::debian inherits tor::repo { - apt::source { $source_name: + apt::source { $tor::repo::source_name: ensure => $::tor::repo::ensure, location => $::tor::repo::location, key => $::tor::repo::key, -- cgit v1.2.3 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(-) 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 42b4e887d52a9a4f59c76fc1afc1c776530ec8ae Mon Sep 17 00:00:00 2001 From: intrigeri Date: Thu, 3 Nov 2016 12:01:59 +0000 Subject: Fix README wrt. usage of the tor::torsocks class (Closes: #2). --- README | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README b/README index 7777438..188acca 100644 --- a/README +++ b/README @@ -113,7 +113,7 @@ Installing torsocks To install torsocks, simply include the 'torsocks' class in your manifests: - class { 'torsocks': } + class { 'tor::torsocks': } You can specify the $ensure_version class parameter to get a specific version installed. -- cgit v1.2.3