Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added basic support for nginx on Solaris. #247

Merged
merged 4 commits into from
Feb 12, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions manifests/package.pp
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,15 @@
before => Anchor['nginx::package::end'],
}
}
'Solaris': {
class { 'nginx::package::solaris':
package_name => $package_name,
package_source => $package_source,
package_ensure => $package_ensure,
require => Anchor['nginx::package::begin'],
before => Anchor['nginx::package::end'],
}
}
default: {
case $::operatingsystem {
'amazon': {
Expand Down
29 changes: 29 additions & 0 deletions manifests/package/solaris.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Class: nginx::package::solaris
#
# This module manages NGINX package installation on solaris based systems
#
# Parameters:
#
# *package_name*
# Needs to be specified. SFEnginx,CSWnginx depending on where you get it.
#
# *package_source*
# Needed in case of Solaris 10.
#
# Actions:
#
# Requires:
#
# Sample Usage:
#
# This class file is not called directly
class nginx::package::solaris(
$package_name = undef,
$package_source = '',
$package_ensure = 'present'
){
package { $package_name:
ensure => $package_ensure,
source => $package_source
}
}
4 changes: 4 additions & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -68,23 +68,27 @@

$nx_logdir = $::kernel ? {
/(?i-mx:linux)/ => '/var/log/nginx',
/(?i-mx:sunos)/ => '/var/log/nginx',
}

$nx_pid = $::kernel ? {
/(?i-mx:linux)/ => '/var/run/nginx.pid',
/(?i-mx:sunos)/ => '/var/run/nginx.pid',
}

if $::osfamily {
$nx_daemon_user = $::osfamily ? {
/(?i-mx:redhat|suse|gentoo|linux)/ => 'nginx',
/(?i-mx:debian)/ => 'www-data',
/(?i-mx:solaris)/ => 'webservd',
}
} else {
warning('$::osfamily not defined. Support for $::operatingsystem is deprecated')
warning("Please upgrade from factor ${::facterversion} to >= 1.7.2")
$nx_daemon_user = $::operatingsystem ? {
/(?i-mx:debian|ubuntu)/ => 'www-data',
/(?i-mx:fedora|rhel|redhat|centos|scientific|suse|opensuse|amazon|gentoo|oraclelinux)/ => 'nginx',
/(?i-mx:solaris)/ => 'webservd',
}
}

Expand Down