Merge pull request #552 from buzzdeee/master

Allow to use OpenBSD specific service_flags and package_flavors.
This commit is contained in:
James Fryman 2015-02-05 14:06:09 -06:00
commit 878ea8ef25
5 changed files with 32 additions and 1 deletions

View file

@ -131,8 +131,9 @@ nginx::nginx_mailhosts:
## Nginx with precompiled Passenger
Currently this works only for Debian family.
Currently this works only for Debian family and OpenBSD.
On Debian it might look like:
```puppet
class { 'nginx':
package_source => 'passenger',
@ -142,6 +143,20 @@ class { 'nginx':
}
```
Here the example for OpenBSD:
```puppet
class { 'nginx':
package_flavor => 'passenger',
service_flags => '-u'
http_cfg_append => {
passenger_root => '/usr/local/lib/ruby/gems/2.1/gems/passenger-4.0.44',
passenger_ruby => '/usr/local/bin/ruby21',
passenger_max_pool_size => '15',
}
}
```
Package source `passenger` will add [Phusion Passenger repository](https://oss-binaries.phusionpassenger.com/apt/passenger) to APT sources.
For each virtual host you should specify which ruby should be used.

View file

@ -102,12 +102,14 @@ class nginx (
$package_ensure = present,
$package_name = $::nginx::params::package_name,
$package_source = 'nginx',
$package_flavor = undef,
$manage_repo = $::nginx::params::manage_repo,
### END Package Configuration ###
### START Service Configuation ###
$configtest_enable = false,
$service_ensure = running,
$service_flags = undef,
$service_restart = '/etc/init.d/nginx configtest && /etc/init.d/nginx restart',
$service_name = undef,
### END Service Configuration ###
@ -210,6 +212,7 @@ class nginx (
package_name => $package_name,
package_source => $package_source,
package_ensure => $package_ensure,
package_flavor => $package_flavor,
notify => Class['::nginx::service'],
manage_repo => $manage_repo,
}
@ -290,6 +293,7 @@ class nginx (
service_ensure => $service_ensure,
service_restart => $service_restart,
service_name => $service_name,
service_flags => $service_flags,
}
create_resources('::nginx::resource::upstream', $nginx_upstreams)

View file

@ -17,6 +17,7 @@ class nginx::package(
$package_name = $::nginx::params::package_name,
$package_source = 'nginx',
$package_ensure = 'present',
$package_flavor = undef,
$manage_repo = $::nginx::params::manage_repo,
) inherits ::nginx::params {
@ -57,6 +58,12 @@ class nginx::package(
source => $package_source,
}
}
'OpenBSD': {
package { $package_name:
ensure => $package_ensure,
flavor => $package_flavor,
}
}
default: {
package { 'nginx':
ensure => $package_ensure,

View file

@ -18,6 +18,7 @@ class nginx::service(
$service_restart = $::nginx::service_restart,
$service_ensure = $::nginx::service_ensure,
$service_name = 'nginx',
$service_flags = undef,
) {
$service_enable = $service_ensure ? {
@ -38,6 +39,7 @@ class nginx::service(
ensure => $service_ensure_real,
name => $service_name,
enable => $service_enable,
flags => $service_flags,
hasstatus => true,
hasrestart => true,
}

View file

@ -21,6 +21,9 @@
"6.0"
]
},
{
"operatingsystem": "OpenBSD"
},
{
"operatingsystem": "RedHat",
"operatingsystemrelease":[