]> gitweb.fluxo.info Git - puppet-tor.git/commitdiff
Factor out Polipo into base and Debian -specific classes.
authorintrigeri <intrigeri@boum.org>
Fri, 8 Jun 2012 15:34:13 +0000 (17:34 +0200)
committerintrigeri <intrigeri@boum.org>
Fri, 8 Jun 2012 15:34:13 +0000 (17:34 +0200)
manifests/polipo.pp
manifests/polipo/base.pp [new file with mode: 0644]
manifests/polipo/debian.pp [new file with mode: 0644]

index 72a92366dafc0a181dd78ac8604bbabd22afad08..a7ef005a7ebdd1f87d3963da807a2c0b7a40b732 100644 (file)
@@ -1,34 +1,8 @@
-class tor::polipo inherits tor {
+class tor::polipo {
+  include ::tor
 
-  package { "polipo":
-    ensure => installed,
+  case $operatingsystem {
+    'debian': { include tor::polipo::debian }
+    default: { include tor::polipo::base }
   }
-
-  service { "polipo":
-    ensure  => running,
-    enable  => true,
-    require => [ Package["polipo"], Service["tor"] ],
-  }
-
-  file { "/etc/polipo/config":
-    ensure  => present,
-    owner   => root,
-    group   => root,
-    mode    => 0644,
-    source  => "puppet:///modules/tor/polipo.conf",
-    require => Package["polipo"],
-    notify  => Service["polipo"],
-  }
-
-  # 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/base.pp b/manifests/polipo/base.pp
new file mode 100644 (file)
index 0000000..81cfe9c
--- /dev/null
@@ -0,0 +1,21 @@
+class tor::polipo::base {
+  package { "polipo":
+    ensure => installed,
+  }
+
+  file { "/etc/polipo/config":
+    ensure  => present,
+    owner   => root,
+    group   => root,
+    mode    => 0644,
+    source  => "puppet:///modules/tor/polipo.conf",
+    require => Package["polipo"],
+    notify  => Service["polipo"],
+  }
+
+  service { "polipo":
+    ensure  => running,
+    enable  => true,
+    require => [ Package["polipo"], Service["tor"] ],
+  }
+}
diff --git a/manifests/polipo/debian.pp b/manifests/polipo/debian.pp
new file mode 100644 (file)
index 0000000..46897dd
--- /dev/null
@@ -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.cron",
+  }
+}