aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormh <mh@immerda.ch>2011-10-28 16:50:30 +0200
committermh <mh@immerda.ch>2011-10-28 16:51:58 +0200
commit8f1d1c4ef7a1298d448416997218dafb5d40166f (patch)
tree069afbe224ffeebd7d0633df9a52a0e3c039d6b3
parent5d2516c3a7a6b34399ff7b856fc9900ef1e41294 (diff)
downloadpuppet-tor-8f1d1c4ef7a1298d448416997218dafb5d40166f.tar.gz
puppet-tor-8f1d1c4ef7a1298d448416997218dafb5d40166f.tar.bz2
decouple polipo and torsocks into their own subclasses, so we can for example also just install tor
-rw-r--r--files/polipo/polipo.conf (renamed from files/polipo.conf)0
-rwxr-xr-xfiles/polipo/polipo.cron (renamed from files/polipo.cron)0
-rw-r--r--manifests/init.pp29
-rw-r--r--manifests/polipo.pp8
-rw-r--r--manifests/polipo/base.pp21
-rw-r--r--manifests/polipo/debian.pp12
-rw-r--r--manifests/torsocks.pp6
7 files changed, 48 insertions, 28 deletions
diff --git a/files/polipo.conf b/files/polipo/polipo.conf
index 12b10c4..12b10c4 100644
--- a/files/polipo.conf
+++ b/files/polipo/polipo.conf
diff --git a/files/polipo.cron b/files/polipo/polipo.cron
index aba88bc..aba88bc 100755
--- a/files/polipo.cron
+++ b/files/polipo/polipo.cron
diff --git a/manifests/init.pp b/manifests/init.pp
index 8b78f65..5d1c3d8 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -1,5 +1,5 @@
class tor {
- package { [ "tor", "polipo", "torsocks" ]:
+ package {'tor':
ensure => installed,
}
@@ -8,31 +8,4 @@ class tor {
enable => true,
require => Package['tor'],
}
-
- service { "polipo":
- ensure => running,
- enable => true,
- }
-
- file { "/etc/polipo/config":
- ensure => present,
- owner => root,
- group => root,
- mode => 0644,
- source => "puppet:///modules/tor/polipo.conf",
- require => Package["polipo"],
- notify => Service["polipo"],
- before => Service["tor"],
- }
-
- # 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.cron",
- }
}
diff --git a/manifests/polipo.pp b/manifests/polipo.pp
new file mode 100644
index 0000000..a7ef005
--- /dev/null
+++ b/manifests/polipo.pp
@@ -0,0 +1,8 @@
+class tor::polipo {
+ include ::tor
+
+ case $operatingsystem {
+ 'debian': { include tor::polipo::debian }
+ default: { include tor::polipo::base }
+ }
+}
diff --git a/manifests/polipo/base.pp b/manifests/polipo/base.pp
new file mode 100644
index 0000000..a634920
--- /dev/null
+++ b/manifests/polipo/base.pp
@@ -0,0 +1,21 @@
+class tor::polipo::base {
+ package{'polipo':
+ ensure => present,
+ }
+
+ file { "/etc/polipo/config":
+ ensure => present,
+ owner => root,
+ group => root,
+ mode => 0644,
+ source => "puppet:///modules/tor/polipo/polipo.conf",
+ require => Package["polipo"],
+ notify => Service["polipo"],
+ before => Service["tor"],
+ }
+
+ service { "polipo":
+ ensure => running,
+ enable => true,
+ }
+}
diff --git a/manifests/polipo/debian.pp b/manifests/polipo/debian.pp
new file mode 100644
index 0000000..1986119
--- /dev/null
+++ b/manifests/polipo/debian.pp
@@ -0,0 +1,12 @@
+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",
+ }
+}
diff --git a/manifests/torsocks.pp b/manifests/torsocks.pp
new file mode 100644
index 0000000..e3221c9
--- /dev/null
+++ b/manifests/torsocks.pp
@@ -0,0 +1,6 @@
+class tor::torsocks {
+ include ::tor
+ package{'torsocks':
+ ensure => present,
+ }
+}