module-nginx/manifests/params.pp

110 lines
3.3 KiB
Puppet
Raw Normal View History

class nginx::params {
### Operating System Configuration
2014-11-22 19:40:01 +01:00
## This is my hacky... no hiera system. Oh well. :)
$_module_defaults = {
'conf_dir' => '/etc/nginx',
'daemon_user' => 'nginx',
'pid' => '/var/run/nginx.pid',
'root_group' => 'root',
2014-11-25 20:07:40 +01:00
'log_dir' => '/var/log/nginx',
'run_dir' => '/var/nginx',
2014-12-08 03:16:52 +01:00
'package_name' => 'nginx',
'manage_repo' => false,
2014-11-22 19:40:01 +01:00
}
case $::osfamily {
2014-11-22 19:40:01 +01:00
'ArchLinux': {
$_module_os_overrides = {
'pid' => false,
'daemon_user' => 'http',
}
}
'Debian': {
if ($::operatingsystem == 'ubuntu' and $::lsbdistcodename in ['lucid', 'precise', 'trusty'])
or ($::operatingsystem == 'debian' and $::operatingsystemmajrelease in ['6', '7', '8']) {
$_module_os_overrides = {
'manage_repo' => true,
'daemon_user' => 'www-data',
}
} else {
$_module_os_overrides = {
'daemon_user' => 'www-data',
}
2014-11-22 19:40:01 +01:00
}
}
'FreeBSD': {
2014-11-22 19:40:01 +01:00
$_module_os_overrides = {
'conf_dir' => '/usr/local/etc/nginx',
'daemon_user' => 'www',
'root_group' => 'wheel',
}
}
2014-12-08 03:16:52 +01:00
'Gentoo': {
$_module_os_overrides = {
'package_name' => 'www-servers/nginx',
}
}
'RedHat': {
if ($::operatingsystem in ['RedHat', 'CentOS'] and $::operatingsystemmajrelease in ['5', '6', '7']) {
$_module_os_overrides = {
'manage_repo' => true,
}
2016-07-24 02:13:05 +02:00
} else {
$_module_os_overrides = {}
}
}
'Solaris': {
2014-11-22 19:40:01 +01:00
$_module_os_overrides = {
2014-12-08 03:16:52 +01:00
'daemon_user' => 'webservd',
'package_name' => undef,
2014-11-22 19:40:01 +01:00
}
}
2014-11-25 20:07:40 +01:00
'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 {
'SmartOS': {
2014-11-22 19:40:01 +01:00
$_module_os_overrides = {
'conf_dir' => '/usr/local/etc/nginx',
'daemon_user' => 'www',
}
}
2014-11-22 19:40:01 +01:00
default: { $_module_os_overrides = {} }
}
}
}
2014-11-22 19:40:01 +01:00
$_module_parameters = merge($_module_defaults, $_module_os_overrides)
### END Operating System Configuration
### Referenced Variables
2014-11-22 19:40:01 +01:00
$conf_dir = $_module_parameters['conf_dir']
2014-11-25 20:07:40 +01:00
$log_dir = $_module_parameters['log_dir']
$run_dir = $_module_parameters['run_dir']
$temp_dir = '/tmp'
2014-11-22 19:40:01 +01:00
$pid = $_module_parameters['pid']
$client_body_temp_path = "${run_dir}/client_body_temp"
2014-11-22 19:40:01 +01:00
$daemon_user = $_module_parameters['daemon_user']
$global_owner = 'root'
2014-11-25 20:07:40 +01:00
$global_group = $_module_parameters['root_group']
$global_mode = '0644'
$http_access_log = "${log_dir}/access.log"
$manage_repo = $_module_parameters['manage_repo']
$nginx_error_log = "${log_dir}/error.log"
2014-11-22 19:40:01 +01:00
$root_group = $_module_parameters['root_group']
2014-12-08 03:16:52 +01:00
$package_name = $_module_parameters['package_name']
2014-11-22 19:40:01 +01:00
$proxy_temp_path = "${run_dir}/proxy_temp"
$sites_available_owner = 'root'
2014-11-25 20:07:40 +01:00
$sites_available_group = $_module_parameters['root_group']
$sites_available_mode = '0644'
$super_user = true
### END Referenced Variables
}