modernize the module
authormh <mh@immerda.ch>
Fri, 26 Jun 2015 12:01:17 +0000 (14:01 +0200)
committermh <mh@immerda.ch>
Fri, 26 Jun 2015 12:01:17 +0000 (14:01 +0200)
manifests/bcrypt.pp
manifests/mail.pp
manifests/maildir.pp
manifests/postgres.pp

index 93bd9b0..e83bc66 100644 (file)
@@ -1,7 +1,14 @@
 class rubygems::bcrypt {
-  require rubygems
-  package{'bcrypt-ruby':
-    ensure => present,
-    provider => gem,
+  if ($::osfamily == 'RedHat') and
+    versioncmp($::operatingsystemmajrelease,'6') > 0 {
+    package{'rubygem-bcrypt':
+      ensure => present,
+    }
+  } else {
+    require rubygems
+    package{'bcrypt-ruby':
+      ensure => present,
+      provider => gem,
+    }
   }
 }
index 4afa0c7..17de50e 100644 (file)
@@ -1,11 +1,19 @@
+# manage the mail rubygem
 class rubygems::mail {
-  require rubygems::devel
-  package{'mail':
-    ensure => present,
-    provider => gem,
-  }
+  if ($::osfamily == 'RedHat') and
+    versioncmp($::operatingsystemmajrelease,'6') > 0 {
+    package{'rubygem-mail':
+      ensure => present,
+    }
+  } else {
+    require rubygems::devel
+    package{'mail':
+      ensure   => present,
+      provider => gem,
+    }
 
-  if $rubyversion == '1.8.6' {
-    require rubygems::tlsmail
+    if $::rubyversion == '1.8.6' {
+      require rubygems::tlsmail
+    }
   }
 }
index 1bdcc05..14bbc62 100644 (file)
@@ -1,7 +1,15 @@
+# manage maildir rubygem
 class rubygems::maildir {
-  require rubygems::devel
-  package{'maildir':
-    ensure => present,
-    provider => gem,
+  if ($::osfamily == 'RedHat') and
+    versioncmp($::operatingsystemmajrelease,'6') > 0 {
+    package{'rubygem-maildir':
+      ensure => present,
+    }
+  } else {
+    require rubygems::devel
+    package{'maildir':
+      ensure   => present,
+      provider => gem,
+    }
   }
 }
index f43c360..af7c563 100644 (file)
@@ -1,5 +1,6 @@
 class rubygems::postgres {
-  if $::operatingsystem == 'CentOS' and $::operatingsystemmajrelease > 5 {
+  if $::osfamily == 'RedHat' and
+    versioncmp($::operatingsystemmajrelease,'5') > 0 {
     package{'rubygem-pg':
       ensure => installed,
     }