Skip to content

Commit

Permalink
Merge pull request #14 from maestrodev/master
Browse files Browse the repository at this point in the history
support operatingsystem RedHat
  • Loading branch information
jfryman committed Sep 17, 2012
2 parents 375dd0f + b9afd22 commit 26c6302
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
4 changes: 2 additions & 2 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Setup a new virtual host

<pre>
node default {
class { 'mcollective': }
class { 'nginx': }
nginx::resource::vhost { 'www.puppetlabs.com':
ensure => present,
www_root => '/var/www/www.puppetlabs.com',
Expand All @@ -29,7 +29,7 @@ Setup a new virtual host
Add a Proxy Server(s)
<pre>
node default {
class { 'mcollective': }
class { 'nginx': }
nginx::resource::upstream { 'puppet_rack_app':
ensure => present,
members => [
Expand Down
2 changes: 1 addition & 1 deletion manifests/package.pp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
anchor { 'nginx::package::end': }

case $::operatingsystem {
centos,fedora,rhel: {
centos,fedora,rhel,redhat: {
class { 'nginx::package::redhat':
require => Anchor['nginx::package::begin'],
before => Anchor['nginx::package::end'],
Expand Down
14 changes: 12 additions & 2 deletions manifests/package/redhat.pp
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,20 @@
class nginx::package::redhat {
$redhat_packages = ['nginx', 'GeoIP', 'gd', 'libXpm', 'libxslt']

$os_type = downcase($::operatingsystem)
if downcase($::operatingsystem) == "redhat" {
$os_type = "rhel"
} else {
$os_type = downcase($::operatingsystem)
}

if $::lsbmajdistrelease == undef {
$os_rel = regsubst($::operatingsystemrelease, '\..*$', '')
} else {
$os_rel = $::lsbmajdistrelease
}

yumrepo { "nginx-release":
baseurl => "http://nginx.org/packages/${os_type}/${::lsbmajdistrelease}/\$basearch/",
baseurl => "http://nginx.org/packages/${os_type}/${os_rel}/\$basearch/",
descr => 'nginx repo',
enabled => '1',
gpgcheck => '0',
Expand Down
4 changes: 2 additions & 2 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
}

$nx_daemon_user = $::operatingsystem ? {
/(?i-mx:debian|ubuntu)/ => 'www-data',
/(?i-mx:fedora|rhel|centos|suse|opensuse)/ => 'nginx',
/(?i-mx:debian|ubuntu)/ => 'www-data',
/(?i-mx:fedora|rhel|redhat|centos|suse|opensuse)/ => 'nginx',
}
}

0 comments on commit 26c6302

Please sign in to comment.