Skip to content

Commit

Permalink
Merge pull request #12 from jantman/param_docs
Browse files Browse the repository at this point in the history
Document parameters for all classes, and variables used by templates
  • Loading branch information
nibalizer committed Jan 17, 2014
2 parents d6a33cd + dccec9f commit fe9898a
Show file tree
Hide file tree
Showing 4 changed files with 150 additions and 9 deletions.
43 changes: 43 additions & 0 deletions manifests/apache/conf.pp
Original file line number Diff line number Diff line change
@@ -1,6 +1,39 @@
# == Class: puppetboard::apache::conf
#
# Creates an entry in your apache configuration directory
# to run PuppetBoard server-wide (i.e. not in a vhost).
#
# === Parameters
#
# Document parameters here.
#
# [*wsgi_alias*]
# (string) WSGI script alias source
# Default: '/puppetboard'
#
# [*threads*]
# (int) Number of WSGI threads to use.
# Defaults to 5
#
# [*user*]
# (string) WSGI daemon process user, and daemon process name
# Defaults to 'puppetboard' ($::puppetboard::params::user)
#
# [*group*]
# (int) WSGI daemon process group owner, and daemon process group
# Defaults to 'puppetboard' ($::puppetboard::params::group)
#
# [*basedir*]
# (string) Base directory where to build puppetboard vcsrepo and python virtualenv.
# Defaults to '/srv/puppetboard' ($::puppetboard::params::basedir)
#
# === Notes:
#
# Make sure you have purge_configs set to false in your apache class!
#
# This runs the WSGI application with a WSGIProcessGroup of $user and
# a WSGIApplicationGroup of %{GLOBAL}.
#
class puppetboard::apache::conf (
$wsgi_alias = '/puppetboard',
$threads = 5,
Expand All @@ -11,6 +44,9 @@

$docroot = "${basedir}/puppetboard"

# Template Uses:
# - $basedir
#
file { "${docroot}/wsgi.py":
ensure => present,
content => template('puppetboard/wsgi.py.erb'),
Expand All @@ -19,6 +55,13 @@
require => User[$user],
}

# Template Uses:
# - $user
# - $group
# - $threads
# - $wsgi_alias
# - $docroot
#
file { "${::puppetboard::params::apache_confd}/puppetboard.conf":
ensure => present,
owner => 'root',
Expand Down
36 changes: 36 additions & 0 deletions manifests/apache/vhost.pp
Original file line number Diff line number Diff line change
@@ -1,3 +1,36 @@
# == Class: puppetboard::apache::vhost
#
# Sets up an apache::vhost to run PuppetBoard,
# and writes an appropriate wsgi.py from template.
#
# === Parameters
#
# Document parameters here.
#
# [*vhost_name*]
# (string) The vhost ServerName.
# No default.
#
# [*port*]
# (int) Port for the vhost to listen on.
# Defaults to 5000.
#
# [*threads*]
# (int) Number of WSGI threads to use.
# Defaults to 5
#
# [*user*]
# (string) WSGI daemon process user, and daemon process name
# Defaults to 'puppetboard' ($::puppetboard::params::user)
#
# [*group*]
# (int) WSGI daemon process group owner, and daemon process group
# Defaults to 'puppetboard' ($::puppetboard::params::group)
#
# [*basedir*]
# (string) Base directory where to build puppetboard vcsrepo and python virtualenv.
# Defaults to '/srv/puppetboard' ($::puppetboard::params::basedir)
#
class puppetboard::apache::vhost (
$vhost_name,
$port = 5000,
Expand All @@ -19,6 +52,9 @@
user => $user,
}

# Template Uses:
# - $basedir
#
file { "${docroot}/wsgi.py":
ensure => present,
content => template('puppetboard/wsgi.py.erb'),
Expand Down
74 changes: 65 additions & 9 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,64 @@
# Document parameters here.
#
# [*user*]
# Puppetboard system user.
# Defaults to 'puppetboard'
# (string) Puppetboard system user.
# Defaults to 'puppetboard' ($::puppetboard::params::user)
#
# [*group*]
# Puppetboard system group.
# Defaults to 'puppetboard'
# (string) Puppetboard system group.
# Defaults to 'puppetboard' ($::puppetboard::params::group)
#
# [*basedir*]
# Base directory where to build puppetboard vcsrepo and python virtualenv.
# Defaults to '/srv/puppetboard'
# (string) Base directory where to build puppetboard vcsrepo and python virtualenv.
# Defaults to '/srv/puppetboard' ($::puppetboard::params::basedir)
#
# [*puppetdb_host*]
# (string) PuppetDB Host
# Defaults to 'localhost' ($::puppetboard::params::puppetdb_host)
#
# [*puppetdb_port*]
# (int) PuppetDB Port
# Defaults to 8080 ($::puppetboard::params::puppetdb_port)
#
# [*puppetdb_key*]
# (string, absolute path) path to PuppetMaster/CA signed client SSL key
# Defaults to 'None' ($::puppetboard::params::puppetdb_key)
#
# [*puppetdb_ssl*]
# (string) whether PuppetDB uses SSL or not, 'True' or 'False'.
# Defaults to 'False' ($::puppetboard::params::puppetdb_ssl)
#
# [*puppetdb_cert*]
# (string, absolute path) path to PuppetMaster/CA signed client SSL cert
# Defaults to 'None' ($::puppetboard::params::puppetdb_cert)
#
# [*puppetdb_timeout*]
# (int) timeout, in seconds, for connecting to PuppetDB
# Defaults to 20 ($::puppetboard::params::puppetdb_timeout)
#
# [*dev_listen_host*]
# (string) host that dev server binds to/listens on
# Defaults to '127.0.0.1' ($::puppetboard::params::dev_listen_host)
#
# [*dev_listen_port*]
# (int) port that dev server binds to/listens on
# Defaults to 5000 ($::puppetboard::params::dev_listen_port)
#
# [*unresponsive*]
# (int) number of hours after which a node is considered "unresponsive"
# Defaults to 3 ($::puppetboard::params::unresponsive)
#
# [*enable_query*]
# (string) Whether to allow the user to run raw queries against PuppetDB. 'True' or 'False'.
# Defaults to 'True' ($::puppetboard::params::enable_query)
#
# [*python_loglevel*]
# (string) Python logging module log level.
# Defaults to 'info' ($::puppetboard::params::python_loglevel)
#
# [*experimental*]
# Enable experimental features.
# Defaults to true
# (string) Enable experimental features. 'True' or 'False'.
# Defaults to true ($::puppetboard::params::experimental)
#
# === Examples
#
Expand Down Expand Up @@ -89,6 +133,19 @@
recurse => true,
}

# Template Uses:
# - $puppetdb_host
# - $puppetdb_port
# - $puppetdb_ssl
# - $puppetdb_key
# - $puppetdb_cert
# - $puppetdb_timeout
# - $dev_listen_host
# - $dev_listen_port
# - $unresponsive
# - $enable_query
# - $python_loglevel
# - $experimental
file { 'puppetboard/default_settings.py':
path => "${basedir}/puppetboard/puppetboard/default_settings.py",
owner => $user,
Expand All @@ -99,7 +156,6 @@
File["${basedir}/puppetboard"],
Python::Virtualenv["${basedir}/virtenv-puppetboard"]
],

}

python::virtualenv { "${basedir}/virtenv-puppetboard":
Expand Down
6 changes: 6 additions & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# == Class: puppetboard::params
#
# Defines default values for puppetboard parameters.
#
# Inherited by Class['puppetboard'].
#
class puppetboard::params {

case $::osfamily {
Expand Down

0 comments on commit fe9898a

Please sign in to comment.