$bandwidth_rate or $bandwidth_burst please be aware that these values have
changed and adjust your configuration as necessary.
+ The $tor_ensure_version was converted to a parameter for the tor and
+ tor::daemon classes.
+
+ The $torsocks_ensure_version was converted to a parameter for the
+ tor::torsocks class.
+
+ The options that used to be settable with the
+ tor::daemon::global_opts define now are parameters for the
+ tor::daemon class, and tor::daemon::global_opts was
+ removed accordingly.
+
Usage
=====
To install tor, simply include the 'tor' class in your manifests:
- include tor
+ class { 'tor': }
-You can specify $tor_ensure_version and $torsocks_ensure_version to get a
-specific version installed.
+You can specify the $ensure_version class parameter to get a specific
+version installed.
However, if you want to make configuration changes to your tor daemon, you will
want to instead include the 'tor::daemon' class in your manifests, which will
inherit the 'tor' class from above:
- include tor::daemon
+ class { '::tor::daemon': }
+
+You have the following class parameters that you can specify:
-You have the following tor global variables that you can adjust in your node scope:
+data_dir (default: '/var/lib/tor')
+config_file (default: '/etc/tor/torrc')
+use_bridges (default: 0)
+automap_hosts_on_resolve (default: 0)
+log_rules (default: ['notice file /var/log/tor/notices.log'])
-$data_dir = '/var/lib/tor'
-$config_file = '/etc/tor/torrc'
-$log_rules = 'notice file /var/log/tor/notices.log'
+The data_dir will be used for the tor user's $HOME, and the tor DataDirectory
+value.
-The $data_dir will be used for the tor user's $HOME, and the tor DataDirectory
-value. The $config_file will be managed and the daemon restarted when it
-changed.
+The config_file will be managed and the daemon restarted when
+it changed.
-The $log_rules can be an array of different Log lines, each will be added to the
+use_bridges and automap_hosts_on_resolve are used to set the
+UseBridges and AutomapHostsOnResolve torrc settings.
+
+The log_rules can be an array of different Log lines, each will be added to the
config, for example the following will use syslog:
- tor::daemon::global_opts { "use_syslog": log_rules => [ 'notice syslog' ]; }
+ class { '::tor::daemon':
+ log_rules => [ 'notice syslog' ],
+ }
+
+If you want to set specific options for the tor class,
+you need to define it before tor::daemon in your manifests,
+e.g.:
+
+ class { '::tor':
+ use_munin => true,
+ }
+ class { '::tor::daemon':
+ automap_hosts_on_resolve => 1,
+ }
Configuring socks
-----------------
$listen_address - can pass multiple values to configure SocksListenAddress lines
$policies - can pass multiple values to configure SocksPolicy lines
+Installing torsocks
+-------------------
+
+To install torsocks, simply include the 'torsocks' class in your manifests:
+
+ class { 'torsocks': }
+
+You can specify the $ensure_version class parameter to get a specific
+version installed.
Configuring relays
==================
=====
If you are using munin, and have the puppet munin module installed, you can set
-the variable $use_munin = true to have graphs setup for you.
+the use_munin parameter to true when defining the tor::daemon class to have
+graphs setup for you.
-class tor::daemon inherits tor {
-
- # config variables
- $data_dir = '/var/lib/tor'
- $config_file = '/etc/tor/torrc'
+class tor::daemon (
+ $data_dir = '/var/lib/tor',
+ $config_file = '/etc/tor/torrc',
+ $use_bridges = 0,
+ $automap_hosts_on_resolve = 0,
+ $log_rules = [ 'notice file /var/log/tor/notices.log' ],
+) inherits tor {
+
+ # constants
$spool_dir = '/var/lib/puppet/modules/tor'
$snippet_dir = "${spool_dir}/torrc.d"
}
# global configurations
- define global_opts( $data_dir = $tor::daemon::data_dir,
- $log_rules = [ 'notice file /var/log/tor/notices.log' ],
- $use_bridges = 0,
- $automap_hosts_on_resolve = 0) {
-
- concatenated_file_part { '01.global':
- dir => $tor::daemon::snippet_dir,
- content => template('tor/torrc.global.erb'),
- owner => 'debian-tor', group => 'debian-tor', mode => 0644,
- }
+ concatenated_file_part { '01.global':
+ dir => $snippet_dir,
+ content => template('tor/torrc.global.erb'),
+ owner => 'debian-tor', group => 'debian-tor', mode => 0644,
}
# socks definition