commit
9c9b5c2c78
11 changed files with 297 additions and 349 deletions
11
Modulefile
11
Modulefile
|
@ -1,9 +1,8 @@
|
|||
name 'jfryman-nginx'
|
||||
name 'puppetlabs-nginx'
|
||||
version '0.0.1'
|
||||
source 'http://github.com/jfryman/puppet-nginx'
|
||||
author 'James Fryman'
|
||||
license 'Apache 2'
|
||||
source 'http://github.com/puppetlabs/puppetlabs-nginx'
|
||||
author 'puppetlabs'
|
||||
license 'Apache License Version 2.0'
|
||||
summary 'Puppet NGINX management module'
|
||||
description 'This module can be used for basic NGINX Management'
|
||||
project_page 'http://github.com/jfryman/puppet-nginx'
|
||||
|
||||
project_page 'http://github.com/puppetlabs/puppetlabs-nginx'
|
||||
|
|
|
@ -14,19 +14,8 @@
|
|||
#
|
||||
# This class file is not called directly
|
||||
class nginx::package::redhat {
|
||||
package { 'nginx':
|
||||
ensure => present,
|
||||
}
|
||||
package { 'GeoIP':
|
||||
ensure => present,
|
||||
}
|
||||
package { 'gd':
|
||||
ensure => present,
|
||||
}
|
||||
package { 'libXpm':
|
||||
ensure => present,
|
||||
}
|
||||
package { 'libxslt':
|
||||
$redhat_packages = ['nginx', 'GeoIP', 'gd', 'libXpm', 'libxslt']
|
||||
package { $redhat_packages:
|
||||
ensure => present,
|
||||
}
|
||||
}
|
|
@ -16,58 +16,14 @@
|
|||
#
|
||||
# This class file is not called directly
|
||||
class nginx::package::suse {
|
||||
package { 'nginx-0.8':
|
||||
$suse_packages = [
|
||||
'nginx-0.8', 'apache2', 'apache2-itk', 'apache2-utils', 'gd', 'libapr1',
|
||||
'libapr-util1', 'libjpeg62', 'libpng14-14', 'libxslt', 'rubygem-daemon_controller',
|
||||
'rubygem-fastthread', 'rubygem-file-tail', 'rubygem-passenger',
|
||||
'rubygem-passenger-nginx', 'rubygem-rack', 'rubygem-rake', 'rubygem-spruz',
|
||||
]
|
||||
|
||||
package { $suse_packages:
|
||||
ensure => present,
|
||||
}
|
||||
package { 'apache2':
|
||||
ensure => present,
|
||||
}
|
||||
package { 'apache2-itk':
|
||||
ensure => present,
|
||||
}
|
||||
package { 'apache2-utils':
|
||||
ensure => present,
|
||||
}
|
||||
package { 'gd':
|
||||
ensure => present,
|
||||
}
|
||||
package { "libapr1":
|
||||
ensure => installed,
|
||||
}
|
||||
package { "libapr-util1":
|
||||
ensure => installed,
|
||||
}
|
||||
package { "libjpeg62":
|
||||
ensure => installed,
|
||||
}
|
||||
package { "libpng14-14":
|
||||
ensure => installed,
|
||||
}
|
||||
package { "libxslt":
|
||||
ensure => installed,
|
||||
}
|
||||
package { "rubygem-daemon_controller":
|
||||
ensure => installed,
|
||||
}
|
||||
package { "rubygem-fastthread":
|
||||
ensure => installed,
|
||||
}
|
||||
package { "rubygem-file-tail":
|
||||
ensure => installed,
|
||||
}
|
||||
package { "rubygem-passenger":
|
||||
ensure => installed,
|
||||
}
|
||||
package { "rubygem-passenger-nginx":
|
||||
ensure => installed,
|
||||
}
|
||||
package { "rubygem-rack":
|
||||
ensure => installed,
|
||||
}
|
||||
package { "rubygem-rake":
|
||||
ensure => installed,
|
||||
}
|
||||
package { "rubygem-spruz":
|
||||
ensure => installed,
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,7 +27,11 @@ class nginx::params {
|
|||
$nx_gzip = on
|
||||
|
||||
$nx_proxy_redirect = off
|
||||
$nx_proxy_set_header = ['Host $host', 'X-Real-IP $remote_addr', 'X-Forwarded-For $proxy_add_x_forwarded_for']
|
||||
$nx_proxy_set_header = [
|
||||
'Host $host', 'X-Real-IP $remote_addr',
|
||||
'X-Forwarded-For $proxy_add_x_forwarded_for',
|
||||
]
|
||||
|
||||
$nx_client_body_temp_path = "${nx_run_dir}/client_body_temp"
|
||||
$nx_client_body_buffer_size = '128k'
|
||||
$nx_client_max_body_size = '10m'
|
||||
|
|
|
@ -25,14 +25,14 @@
|
|||
# vhost => 'test2.local',
|
||||
# }
|
||||
define nginx::resource::location(
|
||||
$ensure = 'present',
|
||||
$ensure = present,
|
||||
$vhost = undef,
|
||||
$location,
|
||||
$www_root = undef,
|
||||
$index_files = ['index.html', 'index.htm', 'index.php'],
|
||||
$proxy = undef,
|
||||
$ssl = 'false',
|
||||
$option = undef
|
||||
$ssl = false,
|
||||
$option = undef,
|
||||
$location
|
||||
) {
|
||||
File {
|
||||
owner => 'root',
|
||||
|
@ -44,7 +44,7 @@ define nginx::resource::location(
|
|||
## Shared Variables
|
||||
$ensure_real = $ensure ? {
|
||||
'absent' => absent,
|
||||
default => 'file',
|
||||
default => file,
|
||||
}
|
||||
|
||||
# Use proxy template if $proxy is defined, otherwise use directory template.
|
||||
|
@ -65,7 +65,6 @@ define nginx::resource::location(
|
|||
fail('Cannot define both directory and proxy in a virtual host')
|
||||
}
|
||||
|
||||
|
||||
## Create stubs for vHost File Fragment Pattern
|
||||
file {"${nginx::config::nx_temp_dir}/nginx.d/${vhost}-500-${name}":
|
||||
ensure => $ensure_real,
|
||||
|
@ -76,7 +75,7 @@ define nginx::resource::location(
|
|||
if ($ssl == 'true') {
|
||||
file {"${nginx::config::nx_temp_dir}/nginx.d/${vhost}-800-${name}-ssl":
|
||||
ensure => $ensure_real,
|
||||
content => $content_re,
|
||||
content => $content_real,
|
||||
}
|
||||
}
|
||||
}
|
|
@ -28,6 +28,7 @@ define nginx::resource::upstream (
|
|||
group => 'root',
|
||||
mode => '0644',
|
||||
}
|
||||
|
||||
file { "/etc/nginx/conf.d/${name}-upstream.conf":
|
||||
ensure => $ensure ? {
|
||||
'absent' => absent,
|
||||
|
|
|
@ -34,10 +34,10 @@ define nginx::resource::vhost(
|
|||
$ensure = 'enable',
|
||||
$listen_ip = '*',
|
||||
$listen_port = '80',
|
||||
$ipv6_enable = 'false',
|
||||
$ipv6_enable = false,
|
||||
$ipv6_listen_ip = '::',
|
||||
$ipv6_listen_port = '80',
|
||||
$ssl = 'false',
|
||||
$ssl = false,
|
||||
$ssl_cert = undef,
|
||||
$ssl_key = undef,
|
||||
$proxy = undef,
|
||||
|
|
Loading…
Reference in a new issue