- Overview
- Usage - Configuration options and additional functionality
- Reference - An under-the-hood peek at what the module is doing and how
- Limitations - OS compatibility, etc.
- Development - Guide for contributing to the module
- Release Notes/Changelog - What the module does and why it is useful
A Puppet module for managing deployments of Patchwork - the web-based patch tracking system
To use this module you can either directly include it in your module
tree, or add the following to your Puppetfile
:
mod 'bramwelt-patchwork'
A node should then be assigned the relevant patchwork classes.
class { 'patchwork':
version => 'v1.0.0'
}
class { 'patchwork::config':
secret_key => 'CHANGEME',
allowed_hosts => ['localhost', '.example.com']
}
A secret key can be generated with the following Linux command:
$ pwgen -sync 50 1 | tr -d "'\""
If you're using Hiera, a basic yaml configuration might look like:
patchwork::version: 'v1.0.0'
patchwork::config::secret_key: 'CHANGEME'
patchwork::config::allowed_hosts:
- 'localhost'
- '.example.com'
After Packwork has been installed and configured, it is up to you to manage the application deployment. This includes:
- Initializing / Migrating the Database:
./manage.py migrate --noinput
- Loading fixtures
./manage.py loaddata default_tags default_states
- Collecting Static files:
./manage.py collectstatic
- Creating admin(s)/superuser(s):
./manage.py createsuperuser
The directory where patchwork should be installed.
Default: '/opt/patchwork'
The directory where the virtualenv should reside.
Default: '/opt/patchwork/venv'
Version of patchwork to be installed.
If 'latest' is specified, the installation will track the tip of the patchwork 'master' branch, otherwise the repo will be ensured 'present' overwriting any local changes that take place.
Default: 'master'
git repo URL for cloning patchwork. Useful for installing your own fork / patched version of patchwork.
Default: 'git://github.com/getpatchwork/patchwork'
User that owns patchwork files and runs the application.
Default 'patchwork'
Group that has access to patchwork files.
Default: 'patchwork'
Installs git. Git is required for cloning patchwork.
Default: true
Installs python, python development libraries, pip, and virtualenv. Required for creating the patchwork virtualenv and installing patchwork's dependencies.
Default: true
Installs a local MySQL server.
Default: true
The name of the patchwork database.
Default: 'patchwork'
Database hostname of the client should connect to.
Databases created either through collect_exported
or manage_database use $::ipaddress
for the
host.
Default: 'localhost'
The username for connection to the database.
Default: 'patchwork'
The password associated with the database username.
Default: 'patchwork'
Exported resource tag to for collecting the database resource onto a database server.
Default: 'mysql-patchwork'
Items in the hash will replace the defaults listed in uwsgi_options
of
the params class.
patchwork::params::uwsgi_options
is defined as:
{
virtualenv => '/opt/patchwork/venv',
chdir => '/opt/patchwork',
static-map => '/static=/opt/patchwork/htdocs',
logto => '/var/log/patchwork/uwsgi.log',
master => true,
http-socket => ':9000',
wsgi-file => 'patchwork.wsgi',
processes => 4,
threads => 2,
}
Default: {}
Changes database definition from a regular resource to an exported resource and allows for creating the database on another server. Also see: database_tag
Default: false
Patchwork uses a cron script to clean up expired registrations, and send notifications of patch changes (for projects with this enabled). This setting defines the number of minutes between patchwork cron job runs.
There is no need to modify notification_delay
since
setting cron_minutes
will also set patchwork::config::notification_delay
.
Default: 10
Manages the Django settings.py file. Most parameter are passed directly through and interpreted as Python. Because settings.py may contain sensitive information, show_diff is disabled for the file.
A secret key for a particular Django installation. This is used to provide cryptographic signing, and should be set to a unique, unpredictable value.
See: SECRET_KEY
Default: undef
A string representing the time zone for this installation.
See: TIME_ZONE
Default: 'Etc/UTC'
A string representing the language code for this installation.
See: LANGUAGE_CODE
Default: 'en_US'
Number of patches listed on each page of a project's patch listing.
Default: '100'
Set to True to always generate https:// links instead of guessing the scheme based on current access. This is useful if SSL protocol is terminated upstream of the server (e.g. at the load balancer)
Default: 'False'
Sets the email address patch notifications, error messages, and validation emails come from.
See:
Default: 'Patchwork <[email protected]>'
A mapping of full names to email addresses. Email addresses listed here will receive emails on server errors which may contain sensitive information.
{
'Django Admin' => '[email protected]',
}
See: ADMINS
Default: {}
A list of strings representing the host/domain names that this Django site can serve.
See: ALLOWED_HOSTS
Default: []
This should be set to the same as cron_minutes
. Number of minutes
patchwork should send Email notifications.
Default: 10
- Set by cron_minutes
Set to True to enable the Patchwork XML-RPC interface. This is needed for pwclient usage.
Default: 'False'
The caching backend to use. Ex:
'django.core.cache.backends.locmem.LocMemCache'
'django.core.cache.backends.memcached.MemcachedCache'
See: BACKEND
Default: 'django.core.cache.backends.locmem.LocMemCache'
A list of strings providing the locations that implement the
cache_backend
.
See: LOCATION
Default: []
A string of either 'None' or a positivive integer respresenting the TTL of entires. A value of 'None' means cache entries will not expire.
See: TIMEOUT
Default: 300
Set to True to enable the Patchwork XML-RPC interface. This is needed for pwclient usage.
See: OPTIONS
Default: {}
Manages an optional selinux module for Patchwork.
Expects the class ::selinux::base
to exist. This class is provided by
the camptocamp/selinux
module and can be installed by adding:
mod 'camptocamp-selinux'
to Puppetfile, or running:
puppet module install camptocamp-selinux
Location of a patchwork selinux module to override the one provided by puppet.
Default: puppet:///module/patchwork/mypatchwork.te
This module has been tested to work with Puppet 4 on the following operating systems:
- CentOS 7
MySQL is currently the only supported database backend for Django.
Patches can be submitted by forking this repo and submitting a pull-request. Along with code changes, patches must include with the following materials:
- Tests
- Documentation
Please see the CHANGELOG for a list of changes available in the current and previous releases.