From 4a0a857a380aae5ad8a8de6cb0e546c08da20c5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20O=CC=88rnstedt?= Date: Thu, 30 Jan 2014 16:41:44 +0100 Subject: [PATCH] Added basic support for nginx on Solaris. --- manifests/package.pp | 9 +++++++++ manifests/package/solaris.pp | 29 +++++++++++++++++++++++++++++ manifests/params.pp | 4 ++++ 3 files changed, 42 insertions(+) create mode 100644 manifests/package/solaris.pp diff --git a/manifests/package.pp b/manifests/package.pp index 956b576..de6ef4f 100644 --- a/manifests/package.pp +++ b/manifests/package.pp @@ -53,6 +53,15 @@ class nginx::package( 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': { diff --git a/manifests/package/solaris.pp b/manifests/package/solaris.pp new file mode 100644 index 0000000..fb1386c --- /dev/null +++ b/manifests/package/solaris.pp @@ -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 + } +} diff --git a/manifests/params.pp b/manifests/params.pp index 6ef1c33..cc858b3 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -68,16 +68,19 @@ class nginx::params { $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') @@ -85,6 +88,7 @@ class nginx::params { $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:debian|solaris)/ => 'webservd', } }