diff options
author | Micah <micah@riseup.net> | 2015-03-27 18:50:01 +0000 |
---|---|---|
committer | Micah <micah@riseup.net> | 2015-03-27 18:50:01 +0000 |
commit | 3925f36f7cd0f15029304363b0f5749750627c96 (patch) | |
tree | 5613a76af8c008a5820e41c097ed94f231412956 /manifests | |
parent | a31579095231c68a2786955b9149d3bcd13400af (diff) | |
parent | 19a44ce97f59633002d844e2b37f2b26b2f1cfbc (diff) | |
download | puppet-tor-3925f36f7cd0f15029304363b0f5749750627c96.tar.gz puppet-tor-3925f36f7cd0f15029304363b0f5749750627c96.tar.bz2 |
Merge branch 'improvements' into 'master'
Improvements
These are a bunch of improvements I got on my github profile in the past.
Interested in merging them?
Summary:
* adds tor repo management
* removes a workaround for a fixed bug
* adds tor-arm support
* support for safe logging
* puppet 3 ready templates.
It's merged on top of the current master.
See merge request !1
Diffstat (limited to 'manifests')
-rw-r--r-- | manifests/arm.pp | 9 | ||||
-rw-r--r-- | manifests/daemon.pp | 3 | ||||
-rw-r--r-- | manifests/daemon/relay.pp | 3 | ||||
-rw-r--r-- | manifests/polipo/debian.pp | 11 | ||||
-rw-r--r-- | manifests/repo.pp | 16 | ||||
-rw-r--r-- | manifests/repo/debian.pp | 9 |
6 files changed, 38 insertions, 13 deletions
diff --git a/manifests/arm.pp b/manifests/arm.pp new file mode 100644 index 0000000..44ddcbb --- /dev/null +++ b/manifests/arm.pp @@ -0,0 +1,9 @@ +# manage tor-arm +class tor::arm ( + $ensure_version = 'installed' +){ + include ::tor + package{'tor-arm': + ensure => $ensure_version, + } +} diff --git a/manifests/daemon.pp b/manifests/daemon.pp index 2440180..2522b2c 100644 --- a/manifests/daemon.pp +++ b/manifests/daemon.pp @@ -6,7 +6,8 @@ class tor::daemon ( $config_file = '/etc/tor/torrc', $use_bridges = 0, $automap_hosts_on_resolve = 0, - $log_rules = [ 'notice file /var/log/tor/notices.log' ] + $log_rules = [ 'notice file /var/log/tor/notices.log' ], + $safe_logging = 1, ) { class{'tor': diff --git a/manifests/daemon/relay.pp b/manifests/daemon/relay.pp index d5296de..3ef8602 100644 --- a/manifests/daemon/relay.pp +++ b/manifests/daemon/relay.pp @@ -3,6 +3,7 @@ define tor::daemon::relay( $port = 0, $listen_addresses = [], $outbound_bindaddresses = [], + $portforwarding = 0, # KB/s, defaulting to using tor's default: 5120KB/s $bandwidth_rate = '', # KB/s, defaulting to using tor's default: 10240KB/s @@ -24,7 +25,7 @@ define tor::daemon::relay( $nickname = $name if $outbound_bindaddresses == [] { - $real_outbound_bindaddresses = $listen_addresses + $real_outbound_bindaddresses = '' } else { $real_outbound_bindaddresses = $outbound_bindaddresses } diff --git a/manifests/polipo/debian.pp b/manifests/polipo/debian.pp index 5ca6922..607b361 100644 --- a/manifests/polipo/debian.pp +++ b/manifests/polipo/debian.pp @@ -1,16 +1,5 @@ # manage polipo on debian class tor::polipo::debian inherits tor::polipo::base { - # TODO: restore file to original state after the following bug is solved: - # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=580434 - file { '/etc/cron.daily/polipo': - ensure => present, - owner => root, - group => root, - mode => '0755', - require => Package['polipo'], - source => 'puppet:///modules/tor/polipo/polipo.cron', - } - Service['polipo'] { hasstatus => false, pattern => '/usr/bin/polipo', diff --git a/manifests/repo.pp b/manifests/repo.pp new file mode 100644 index 0000000..f625599 --- /dev/null +++ b/manifests/repo.pp @@ -0,0 +1,16 @@ +class tor::repo ( + $ensure = present, + $source_name = 'torproject.org', + $include_src = false, +) { + case $::osfamily { + 'Debian': { + $key = '886DDD89' + $location = 'https://deb.torproject.org/torproject.org/' + 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") + } + } +} diff --git a/manifests/repo/debian.pp b/manifests/repo/debian.pp new file mode 100644 index 0000000..174c331 --- /dev/null +++ b/manifests/repo/debian.pp @@ -0,0 +1,9 @@ +# PRIVATE CLASS: do not use directly +class tor::repo::debian inherits tor::repo { + apt::source { $source_name: + ensure => $::tor::repo::ensure, + location => $::tor::repo::location, + key => $::tor::repo::key, + include_src => $::tor::repo::include_src, + } +} |