Updated Documentation
This commit is contained in:
parent
b6d58f042d
commit
eedaa5159c
12 changed files with 34 additions and 172 deletions
|
@ -3,9 +3,7 @@ version '0.0.1'
|
|||
source 'http://github.com/jfryman/puppet-nginx'
|
||||
author 'James Fryman'
|
||||
license 'Apache 2'
|
||||
summary 'Puppet NGinX management module'
|
||||
summary 'Puppet NGINX management module'
|
||||
description 'This module can be used for basic NGINX Management'
|
||||
project_page 'http://github.com/jfryman/puppet-nginx'
|
||||
|
||||
## Add dependencies, if any:
|
||||
# dependency 'username/name', '>= 1.2.0'
|
||||
|
|
24
README
24
README
|
@ -1,24 +0,0 @@
|
|||
nginx
|
||||
|
||||
This is the nginx module.
|
||||
|
||||
User Stories:
|
||||
* Must be able to be used on a major linux system
|
||||
- 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 [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 [DONE]
|
||||
- vhost must be able to point to N proxies
|
||||
- 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.
|
|
@ -1,22 +0,0 @@
|
|||
Files
|
||||
=====
|
||||
|
||||
Puppet comes with both a client and server for copying files around. The file
|
||||
serving function is provided as part of the central Puppet daemon,
|
||||
puppetmasterd, and the client function is used through the source attribute of
|
||||
file objects. Learn more at
|
||||
http://projects.puppetlabs.com/projects/puppet/wiki/File_Serving_Configuration
|
||||
|
||||
You can use managed files like this:
|
||||
|
||||
class myclass {
|
||||
package { mypackage: ensure => latest }
|
||||
service { myservice: ensure => running }
|
||||
file { "/etc/myfile":
|
||||
source => "puppet://$servername/modules/mymodule/myfile"
|
||||
}
|
||||
}
|
||||
|
||||
The files are searched for in:
|
||||
|
||||
$modulepath/mymodule/files/myfile
|
|
@ -1,22 +0,0 @@
|
|||
Facter
|
||||
======
|
||||
|
||||
Define facts in this directory.
|
||||
|
||||
Sometimes you need to be able to write conditional expressions based
|
||||
on site-specific data that just isn’t available via Facter. The
|
||||
solution may be to add a fact to Facter. These additional facts can
|
||||
then be distributed to Puppet clients and are available for use in
|
||||
manifests. Learn more at
|
||||
http://projects.puppetlabs.com/projects/puppet/wiki/Adding_Facts
|
||||
|
||||
File paths should match the fact name; for example, a fact
|
||||
`hardware_platform`, defined like this:
|
||||
|
||||
Facter.add("hardware_platform") do
|
||||
setcode do
|
||||
%x{/bin/uname -i}.chomp
|
||||
end
|
||||
end
|
||||
|
||||
Should be found in `hardware_platform.rb` in this directory.
|
|
@ -1,17 +0,0 @@
|
|||
Functions
|
||||
=========
|
||||
|
||||
Define functions in this directory.
|
||||
|
||||
File paths should match the function name; for example, a function
|
||||
`myfunction`, defined like this:
|
||||
|
||||
Puppet::Parser::Functions::newfunction(
|
||||
:myfunction,
|
||||
:type => :statement,
|
||||
:doc => "Documentation here."
|
||||
) do |vals|
|
||||
# ...
|
||||
end
|
||||
|
||||
Should be found in `myfunction.rb` in this directory.
|
|
@ -1,14 +0,0 @@
|
|||
Providers
|
||||
=========
|
||||
|
||||
Define providers under this directory.
|
||||
|
||||
File paths should match the resource type name and provider name; for
|
||||
example, a provider `myprovider` for a resource type `mytype`, defined like this:
|
||||
|
||||
Puppet::Type.type(:mytype).provide(:myprovider) do
|
||||
desc "Documentation here"
|
||||
# ...
|
||||
end
|
||||
|
||||
Should be found in `mytype/myprovider.rb` under this directory.
|
|
@ -1,14 +0,0 @@
|
|||
Resource Types
|
||||
==============
|
||||
|
||||
Define resource types in this directory.
|
||||
|
||||
Filenames should match the resource type name; for example, a resource
|
||||
type `mytype`, defined like this:
|
||||
|
||||
Puppet::Type.newtype(:mytype) do
|
||||
@doc = "Documentation here."
|
||||
# ...
|
||||
end
|
||||
|
||||
Should be found in `mytype.rb`
|
|
@ -1,28 +0,0 @@
|
|||
Manifests
|
||||
=========
|
||||
|
||||
Module manifest files belong in this directory.
|
||||
|
||||
`init.pp` defines how the module will carry out its tasks in this file.
|
||||
|
||||
Add additional definitions in this directory. Their file paths should match the
|
||||
definition name; for example, a definition `mydefinition`, defined like this:
|
||||
|
||||
# Definition: mydefinition
|
||||
#
|
||||
# This is the mydefinition in the mymodule module.
|
||||
#
|
||||
# Parameters:
|
||||
#
|
||||
# Actions:
|
||||
#
|
||||
# Requires:
|
||||
#
|
||||
# Sample Usage:
|
||||
#
|
||||
# [Remember: No empty lines between comments and class definition]
|
||||
define mydefinition {
|
||||
# ...
|
||||
}
|
||||
|
||||
Should be found in `mydefinition.pp` in this directory.
|
|
@ -1,23 +0,0 @@
|
|||
Templates
|
||||
=========
|
||||
|
||||
Puppet supports templates and templating via ERB, which is part of the Ruby
|
||||
standard library and is used for many other projects including Ruby on Rails.
|
||||
Templates allow you to manage the content of template files, for example
|
||||
configuration files that cannot yet be managed as a Puppet type. Learn more at
|
||||
http://projects.puppetlabs.com/projects/puppet/wiki/Puppet_Templating
|
||||
|
||||
You can use templates like this:
|
||||
|
||||
class myclass {
|
||||
package { mypackage: ensure => latest }
|
||||
service { myservice: ensure => running }
|
||||
file { "/etc/myfile":
|
||||
content => template("mymodule/myfile.erb")
|
||||
}
|
||||
}
|
||||
|
||||
The templates are searched for in:
|
||||
|
||||
$templatedir/mymodule/myfile.erb
|
||||
$modulepath/mymodule/templates/myfile.erb
|
10
tests/upstream.pp
Normal file
10
tests/upstream.pp
Normal file
|
@ -0,0 +1,10 @@
|
|||
include nginx
|
||||
|
||||
nginx::resource::upstream { 'proxypass':
|
||||
ensure => present,
|
||||
members => [
|
||||
'localhost:3000',
|
||||
'localhost:3001',
|
||||
'localhost:3002',
|
||||
],
|
||||
}
|
|
@ -1,7 +1,8 @@
|
|||
include nginix
|
||||
|
||||
nginix::vhost { 'www.test.com':
|
||||
port => '80',
|
||||
webroot => "/opt/www/test",
|
||||
ssl => false,
|
||||
}
|
||||
nginx::resource::vhost { 'test.local':
|
||||
ensure => present,
|
||||
ipv6_enable => 'true',
|
||||
proxy => 'http://proxypass',
|
||||
}
|
||||
|
||||
|
|
17
tests/vhost_ssl.erb
Normal file
17
tests/vhost_ssl.erb
Normal file
|
@ -0,0 +1,17 @@
|
|||
include nginx
|
||||
|
||||
nginx::resource::vhost { 'test2.local':
|
||||
ensure => present,
|
||||
www_root => '/var/www/nginx-default',
|
||||
ssl => 'true',
|
||||
ssl_cert => '/tmp/server.crt',
|
||||
ssl_key => '/tmp/server.pem',
|
||||
}
|
||||
|
||||
nginx::resource::location { 'test2.local-bob':
|
||||
ensure => present,
|
||||
www_root => '/var/www/bob',
|
||||
location => '/bob',
|
||||
vhost => 'test2.local',
|
||||
}
|
||||
|
Loading…
Reference in a new issue