Updated Package Layout

This commit is contained in:
James Fryman 2011-06-06 10:04:24 -05:00
parent 11a1bc43da
commit 4558791e49
7 changed files with 50 additions and 36 deletions

19
README
View file

@ -4,16 +4,21 @@ This is the nginx module.
User Stories:
* Must be able to be used on a major linux system
- Ubuntu (LTS/Current)
- Debian (stable)
- CentOS/RHEL/Fedora
- SLES
- Ubuntu (LTS/Current) [DONE]
- Debian (stable) [DONE]
- CentOS [DONE]
- RHEL [CANNOT TEST]
- Fedora [DONE]
- SLES
- Solaris (optional goal)
* Must be able to install NGINX
- must have an option to perform a base install
- must have an option to perform a base install [DONE]
- must have an option to install a PHP/MySQL Stack
- must have an option to install a Perl/MySQL stack
* Must be able to create a new vhost
- vhost must be able to be ssl enabled
- vhost must be able to be ssl enabled [DONE]
- vhost must be able to point to N proxies
- vhost must be able to create a rewrite rule
- vhost must be able to create a rewrite rule
* errors detected:
fails on ipv6 if ipv6 is not enabled on the host. Need some error check.

View file

@ -17,5 +17,4 @@ class nginx {
include nginx::service
Class['nginx::package'] -> Class['nginx::config'] ~> Class['nginx::service']
}

View file

@ -1,23 +1,10 @@
class nginx::package {
package { 'nginx':
ensure => present,
}
case $operatingsystem {
rhel,centos,oel: {
package { 'GeoIP':
ensure => present,
}
package { 'gd':
ensure => present,
}
package { 'libXpm':
ensure => present,
}
package { 'libxslt':
ensure => present,
}
}
}
case $operatingsystem {
centos,fedora,rhel: {
include nginx::package::redhat
}
debian,ubuntu: {
include nginx::package::debian
}
}
}

View file

@ -0,0 +1,5 @@
class nginx::package::debian {
package { 'nginx':
ensure => present,
}
}

View file

@ -0,0 +1,17 @@
class nginx::package::redhat {
package { 'nginx':
ensure => present,
}
package { 'GeoIP':
ensure => present,
}
package { 'gd':
ensure => present,
}
package { 'libXpm':
ensure => present,
}
package { 'libxslt':
ensure => present,
}
}

View file

@ -16,7 +16,8 @@ define nginx::vhost(
if ($ssl == 'true') {
if ($ssl_cert == undef) {
fail('SSL Certificate (ssl_cert) must be defined and exist on the target system(s)')
} elsif ($ssl_key == undef) {
}
if ($ssl_key == undef) {
fail('SSL Private Key (ssl_key) must be defined and exist on the target system(s)')
}
}

View file

@ -1,7 +1,7 @@
server {
listen <%= listen_ip %>;
<% if ipv6_enable == 'true' %>listen [<%= ipv6_listen_ip %>]:<%= ipv6_listen_port %> default ipv6only=on;<% end %>
server_name <%= name %>;
listen <%= listen_ip %>;
<% if ipv6_enable == 'true' %>listen [<%= ipv6_listen_ip %>]:<%= ipv6_listen_port %> default ipv6only=on;<% end %>
server_name <%= name %>;
access_log <%= scope.lookupvar('nginx::params::nx_logdir')%>/<%= name %>.access.log;
@ -13,11 +13,11 @@ server {
<% if ssl == 'true' %>
server {
listen 443;
listen 443;
server_name <%= name %>;
ssl on;
ssl_certificate <%= ssl_cert %>;
ssl on;
ssl_certificate <%= ssl_cert %>;
ssl_certificate_key <%= ssl_key %>;
ssl_session_timeout 5m;