diff options
-rw-r--r-- | manifests/bcrypt.pp | 15 | ||||
-rw-r--r-- | manifests/init.pp | 8 | ||||
-rw-r--r-- | manifests/ip.pp | 7 | ||||
-rw-r--r-- | manifests/mail.pp | 22 | ||||
-rw-r--r-- | manifests/maildir.pp | 16 | ||||
-rw-r--r-- | manifests/postgres.pp | 3 | ||||
-rw-r--r-- | manifests/sinatra.pp | 7 | ||||
-rw-r--r-- | manifests/thin.pp | 7 | ||||
-rw-r--r-- | manifests/xmlsimple.pp | 10 |
9 files changed, 76 insertions, 19 deletions
diff --git a/manifests/bcrypt.pp b/manifests/bcrypt.pp index 93bd9b0..e83bc66 100644 --- a/manifests/bcrypt.pp +++ b/manifests/bcrypt.pp @@ -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, + } } } diff --git a/manifests/init.pp b/manifests/init.pp index 26cf8b2..0b6198d 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -13,9 +13,13 @@ # the Free Software Foundation. # +# manage rubygems basics class rubygems { - package{'rubygems': - ensure => installed, + # from debian 8 on this is not anymore needed as it's part of the ruby pkg + if ($::operatingsystem != 'Debian') or (versioncmp($::operatingsystemmajrelease,'8') < 0) { + package{'rubygems': + ensure => installed, + } } file { '/etc/gemrc': source => [ 'puppet:///modules/site_rubygems/gemrc', diff --git a/manifests/ip.pp b/manifests/ip.pp new file mode 100644 index 0000000..190d869 --- /dev/null +++ b/manifests/ip.pp @@ -0,0 +1,7 @@ +class rubygems::ip { + require rubygems + package{'ip': + ensure => present, + provider => gem, + } +} diff --git a/manifests/mail.pp b/manifests/mail.pp index 4afa0c7..17de50e 100644 --- a/manifests/mail.pp +++ b/manifests/mail.pp @@ -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 + } } } diff --git a/manifests/maildir.pp b/manifests/maildir.pp index 1bdcc05..14bbc62 100644 --- a/manifests/maildir.pp +++ b/manifests/maildir.pp @@ -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, + } } } diff --git a/manifests/postgres.pp b/manifests/postgres.pp index 00f09be..af7c563 100644 --- a/manifests/postgres.pp +++ b/manifests/postgres.pp @@ -1,5 +1,6 @@ class rubygems::postgres { - if $operatingsystem == 'CentOS' and $lsbmajdistrelease > 5 { + if $::osfamily == 'RedHat' and + versioncmp($::operatingsystemmajrelease,'5') > 0 { package{'rubygem-pg': ensure => installed, } diff --git a/manifests/sinatra.pp b/manifests/sinatra.pp new file mode 100644 index 0000000..327f829 --- /dev/null +++ b/manifests/sinatra.pp @@ -0,0 +1,7 @@ +class rubygems::sinatra { + require rubygems + package{'sinatra': + ensure => present, + provider => gem, + } +} diff --git a/manifests/thin.pp b/manifests/thin.pp new file mode 100644 index 0000000..b2499d8 --- /dev/null +++ b/manifests/thin.pp @@ -0,0 +1,7 @@ +class rubygems::thin { + require rubygems + package{'thin': + ensure => present, + provider => gem, + } +} diff --git a/manifests/xmlsimple.pp b/manifests/xmlsimple.pp index 0e3e3a8..7b00204 100644 --- a/manifests/xmlsimple.pp +++ b/manifests/xmlsimple.pp @@ -1,12 +1,20 @@ +# xml simple lib class rubygems::xmlsimple { package{'rubygem-xml-simple': ensure => present, } - case $operatingsystem { + case $::operatingsystem { debian,ubuntu: { Package['rubygem-xml-simple']{ name => 'libxml-simple-ruby' } } } + if $::operatingsystem == 'CentOS' and $::operatingsystemmajrelease > 6 { + # not yet packaged + Package['rubygem-xml-simple']{ + name => 'xml-simple', + provider => gem, + } + } } |