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

Add initial OpenBSD support. #507

Merged
merged 1 commit into from
Nov 25, 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
8 changes: 8 additions & 0 deletions manifests/package.pp
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,14 @@
before => Anchor['nginx::package::end'],
}
}
'OpenBSD': {
class { 'nginx::package::openbsd':
package_name => $package_name,
package_ensure => $package_ensure,
require => Anchor['nginx::package::begin'],
before => Anchor['nginx::package::end'],
}
}
default: {
case $::operatingsystem {
'amazon': {
Expand Down
12 changes: 12 additions & 0 deletions manifests/package/openbsd.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Class: nginx::package::openbsd
#
# Manage the nginx package on OpenBSD
class nginx::package::openbsd (
$package_name = 'nginx',
$package_ensure = 'present'
) {

package { $package_name:
ensure => $package_ensure,
}
}
18 changes: 14 additions & 4 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
'daemon_user' => 'nginx',
'pid' => '/var/run/nginx.pid',
'root_group' => 'root',
'log_dir' => '/var/log/nginx',
'run_dir' => '/var/nginx',
}
case $::osfamily {
'ArchLinux': {
Expand All @@ -31,6 +33,14 @@
'daemon_user' => 'webservd',
}
}
'OpenBSD': {
$_module_os_overrides = {
'daemon_user' => 'www',
'root_group' => 'wheel',
'log_dir' => '/var/www/logs',
'run_dir' => '/var/www',
}
}
default: {
## For cases not covered in $::osfamily
case $::operatingsystem {
Expand All @@ -50,22 +60,22 @@

### Referenced Variables
$conf_dir = $_module_parameters['conf_dir']
$log_dir = '/var/log/nginx'
$run_dir = '/var/nginx'
$log_dir = $_module_parameters['log_dir']
$run_dir = $_module_parameters['run_dir']
$temp_dir = '/tmp'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you restructure this block so the log_dir/run_dir overrides are set in $_module_os_overrides, and these parameters are set to $_module_parameters['log_dir'] and $_module_parameters['run_dir']? Like you did with global_group and sites_available_group

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@3flex Ok, I'll try to fix it in one of the following days.

$pid = $_module_parameters['pid']

$client_body_temp_path = "${run_dir}/client_body_temp"
$daemon_user = $_module_parameters['daemon_user']
$global_owner = 'root'
$global_group = 'root'
$global_group = $_module_parameters['root_group']
$global_mode = '0644'
$http_access_log = "${log_dir}/access.log"
$nginx_error_log = "${log_dir}/error.log"
$root_group = $_module_parameters['root_group']
$proxy_temp_path = "${run_dir}/proxy_temp"
$sites_available_owner = 'root'
$sites_available_group = 'root'
$sites_available_group = $_module_parameters['root_group']
$sites_available_mode = '0644'
$super_user = true
### END Referenced Variables
Expand Down