summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormh <mh@immerda.ch>2011-07-07 02:06:20 +0200
committermh <mh@immerda.ch>2011-07-07 02:06:36 +0200
commit50c377ccc2748aa8355fe0762341723bf45ae7db (patch)
tree6dc1fe27e9fb7d31ce98a5f4e6ef9acc752618dc
parentdb9ae1e8e30a6065779b84194571a725b67eaf9c (diff)
downloadpuppet-ekeyd-50c377ccc2748aa8355fe0762341723bf45ae7db.tar.gz
puppet-ekeyd-50c377ccc2748aa8355fe0762341723bf45ae7db.tar.bz2
refactor egd to be multiple os capable
-rw-r--r--manifests/egd.pp17
-rw-r--r--manifests/egd/base.pp17
-rw-r--r--manifests/egd/debian.pp6
3 files changed, 23 insertions, 17 deletions
diff --git a/manifests/egd.pp b/manifests/egd.pp
index 8a7da6f..cb5fcca 100644
--- a/manifests/egd.pp
+++ b/manifests/egd.pp
@@ -1,17 +1,10 @@
class ekeyd::egd {
- package{'ekeyd-egd-linux':
- ensure => present,
- before => Service['egd-linux'],
+ if ( $virtual == "vserver" ) {
+ fail("This class shouldn't be included on vservers")
}
- service{'egd-linux':
- enable => true,
- ensure => running,
- }
-
- if $use_shorewall {
- Service['egd-linux']{
- require => Service['shorewall'],
- }
+ case $operatingsystem {
+ debian: { include ekeyd::egd::debian }
+ default: { include ekeyd::egd::base }
}
}
diff --git a/manifests/egd/base.pp b/manifests/egd/base.pp
new file mode 100644
index 0000000..d75d804
--- /dev/null
+++ b/manifests/egd/base.pp
@@ -0,0 +1,17 @@
+class ekeyd::egd::base {
+ package{'ekeyd-egd-linux':
+ ensure => present,
+ before => Service['egd-linux'],
+ }
+
+ service{'egd-linux':
+ enable => true,
+ ensure => running,
+ }
+
+ if $use_shorewall {
+ Service['egd-linux']{
+ require => Service['shorewall'],
+ }
+ }
+}
diff --git a/manifests/egd/debian.pp b/manifests/egd/debian.pp
index e586e82..57550b0 100644
--- a/manifests/egd/debian.pp
+++ b/manifests/egd/debian.pp
@@ -1,7 +1,4 @@
-class ekeyd::egd::debian inherits ekeyd::egd {
- if ( $virtual == "vserver" ) {
- fail("This class shouldn't be included on vservers")
- }
+class ekeyd::egd::debian inherits ekeyd::egd::base {
Package["ekeyd-egd-linux"] {
ensure => $lsbdistcodename ? {
@@ -12,7 +9,6 @@ class ekeyd::egd::debian inherits ekeyd::egd {
Service["egd-linux"] {
name => 'ekeyd-egd-linux',
- ensure => running,
hasstatus => true,
subscribe => File["/etc/default/ekeyd-egd-linux"],
}