Install rubygems for puppetmaster on CentOS 6

This commit is contained in:
Ossi Salmi 2012-04-18 15:53:04 +03:00
parent 77d23db4b2
commit 274cee2ad8
2 changed files with 27 additions and 13 deletions

View file

@ -3,14 +3,27 @@
# #
class mongrel { class mongrel {
require ruby::rubygems
package { "mongrel": package { "mongrel":
name => $operatingsystem ? { ensure => installed,
name => $operatingsystem ? {
openbsd => "ruby-mongrel", openbsd => "ruby-mongrel",
debian => "mongrel", debian => "mongrel",
ubuntu => "mongrel", ubuntu => "mongrel",
centos => $operatingsystemrelease ? {
/^[1-5]/ => "rubygem-mongrel",
default => "mongrel",
},
default => "rubygem-mongrel", default => "rubygem-mongrel",
}, },
ensure => installed, provider => $operatingsystem ? {
centos => $operatingsystemrelease ? {
/^[1-5]/ => undef,
default => "gem",
},
default => undef,
},
} }
} }

View file

@ -218,6 +218,7 @@ class puppet::server::common inherits puppet::client {
} }
if $puppet_storeconfigs != "none" { if $puppet_storeconfigs != "none" {
require ruby::rubygems
case $operatingsystem { case $operatingsystem {
"centos": { "centos": {
if $operatingsystemrelease =~ /^[1-5]/ { if $operatingsystemrelease =~ /^[1-5]/ {
@ -225,6 +226,15 @@ class puppet::server::common inherits puppet::client {
"rubygem-sqlite3-ruby", ]: "rubygem-sqlite3-ruby", ]:
ensure => installed, ensure => installed,
} }
} else {
package { "rails":
ensure => "2.3.14",
provider => "gem",
}
package { "sqlite3":
ensure => installed,
provider => "gem",
}
} }
} }
"debian","ubuntu": { "debian","ubuntu": {
@ -489,6 +499,7 @@ class puppet::server::mongrel {
} }
include ldap::client::ruby include ldap::client::ruby
include ::mongrel
service { "puppetmaster": service { "puppetmaster":
ensure => running, ensure => running,
@ -496,17 +507,7 @@ class puppet::server::mongrel {
hasstatus => true, hasstatus => true,
subscribe => File["/etc/puppet/fileserver.conf", subscribe => File["/etc/puppet/fileserver.conf",
"/etc/puppet/puppet.conf"], "/etc/puppet/puppet.conf"],
} require => Package["puppetmaster", "mongrel"],
if $operatingsystem == "CentOS" and $operatingsystemrelease !~ /^[1-5]/ {
Service["puppetmaster"] {
require => Package["puppetmaster"]
}
} else {
include ::mongrel
Service["puppetmaster"] {
require => Package["puppetmaster", "mongrel"]
}
} }
case $operatingsystem { case $operatingsystem {