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

Allow to use OpenBSD specific service_flags and package_flavors. #552

Merged
merged 1 commit into from
Feb 5, 2015
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
17 changes: 16 additions & 1 deletion README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,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',
Expand All @@ -141,6 +142,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.

Expand Down
4 changes: 4 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,14 @@
$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 ###
Expand Down Expand Up @@ -210,6 +212,7 @@
package_name => $package_name,
package_source => $package_source,
package_ensure => $package_ensure,
package_flavor => $package_flavor,
notify => Class['::nginx::service'],
manage_repo => $manage_repo,
}
Expand Down Expand Up @@ -291,6 +294,7 @@
service_ensure => $service_ensure,
service_restart => $service_restart,
service_name => $service_name,
service_flags => $service_flags,
}

create_resources('::nginx::resource::upstream', $nginx_upstreams)
Expand Down
7 changes: 7 additions & 0 deletions manifests/package.pp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
$package_name = $::nginx::params::package_name,
$package_source = 'nginx',
$package_ensure = 'present',
$package_flavor = undef,
$manage_repo = $::nginx::params::manage_repo,
) inherits ::nginx::params {

Expand Down Expand Up @@ -57,6 +58,12 @@
source => $package_source,
}
}
'OpenBSD': {
package { $package_name:
ensure => $package_ensure,
flavor => $package_flavor,
}
}
default: {
package { 'nginx':
ensure => $package_ensure,
Expand Down
2 changes: 2 additions & 0 deletions manifests/service.pp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
$service_restart = $::nginx::service_restart,
$service_ensure = $::nginx::service_ensure,
$service_name = 'nginx',
$service_flags = undef,
) {

$service_enable = $service_ensure ? {
Expand All @@ -38,6 +39,7 @@
ensure => $service_ensure_real,
name => $service_name,
enable => $service_enable,
flags => $service_flags,
hasstatus => true,
hasrestart => true,
}
Expand Down
3 changes: 3 additions & 0 deletions metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
"6.0"
]
},
{
"operatingsystem": "OpenBSD"
},
{
"operatingsystem": "RedHat",
"operatingsystemrelease":[
Expand Down