From 2960c10cd408d10f45d0caa6586d9c0bff524bea Mon Sep 17 00:00:00 2001 From: Sebastian Reitenbach Date: Fri, 23 Jan 2015 15:11:42 +0100 Subject: [PATCH] Allow to use OpenBSD specific service_flags and package_flavors. Give example for passenger in README.md and add OpenBSD to the supported OSs in metadata.json. --- README.markdown | 17 ++++++++++++++++- manifests/init.pp | 4 ++++ manifests/package.pp | 7 +++++++ manifests/service.pp | 2 ++ metadata.json | 3 +++ 5 files changed, 32 insertions(+), 1 deletion(-) diff --git a/README.markdown b/README.markdown index 32ef21cd7..0d7158b08 100644 --- a/README.markdown +++ b/README.markdown @@ -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', @@ -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. diff --git a/manifests/init.pp b/manifests/init.pp index 66e42e90d..e4589ed09 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -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 ### @@ -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, } @@ -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) diff --git a/manifests/package.pp b/manifests/package.pp index 6c76032ca..d053de21d 100644 --- a/manifests/package.pp +++ b/manifests/package.pp @@ -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 { @@ -57,6 +58,12 @@ source => $package_source, } } + 'OpenBSD': { + package { $package_name: + ensure => $package_ensure, + flavor => $package_flavor, + } + } default: { package { 'nginx': ensure => $package_ensure, diff --git a/manifests/service.pp b/manifests/service.pp index fa7fedc12..410259628 100644 --- a/manifests/service.pp +++ b/manifests/service.pp @@ -18,6 +18,7 @@ $service_restart = $::nginx::service_restart, $service_ensure = $::nginx::service_ensure, $service_name = 'nginx', + $service_flags = undef, ) { $service_enable = $service_ensure ? { @@ -38,6 +39,7 @@ ensure => $service_ensure_real, name => $service_name, enable => $service_enable, + flags => $service_flags, hasstatus => true, hasrestart => true, } diff --git a/metadata.json b/metadata.json index d3ad5bdd2..a7d67b853 100644 --- a/metadata.json +++ b/metadata.json @@ -21,6 +21,9 @@ "6.0" ] }, + { + "operatingsystem": "OpenBSD" + }, { "operatingsystem": "RedHat", "operatingsystemrelease":[