Forge Home

patchwork

Web-based patch tracking system designed to facilitate the contribution and management of contributions to open-source projects

12,118 downloads

7,079 latest version

4.3 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Support the Puppet Community by contributing to this module

You are welcome to contribute to this module by suggesting new features, currency updates, or fixes. Every contribution is valuable to help ensure that the module remains compatible with the latest Puppet versions and continues to meet community needs. Complete the following steps:

  1. Review the module’s contribution guidelines and any licenses. Ensure that your planned contribution aligns with the author’s standards and any legal requirements.
  2. Fork the repository on GitHub, make changes on a branch of your fork, and submit a pull request. The pull request must clearly document your proposed change.

For questions about updating the module, contact the module’s author.

Version information

  • 0.4.0 (latest)
  • 0.3.1
  • 0.3.0
  • 0.2.2
  • 0.2.1
  • 0.2.0
  • 0.1.2
  • 0.1.1
  • 0.1.0
released Jun 17th 2016
This version is compatible with:
  • Puppet Enterprise 3.x
  • Puppet >=3.0.0 <5.0.0
  • ,

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'bramwelt-patchwork', '0.4.0'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add bramwelt-patchwork
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install bramwelt-patchwork --version 0.4.0

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Download

Documentation

bramwelt/patchwork — version 0.4.0 Jun 17th 2016

patchwork

Table of Contents

  1. Overview
  2. Usage - Configuration options and additional functionality
  3. Reference - An under-the-hood peek at what the module is doing and how
  4. Limitations - OS compatibility, etc.
  5. Development - Guide for contributing to the module
  6. Release Notes/Changelog - What the module does and why it is useful

Overview

Build Status

A Puppet module for managing deployments of Patchwork - the web-based patch tracking system

Usage

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

Reference

patchwork

install_dir

The directory where patchwork should be installed.

Default: '/opt/patchwork'

virtualenv_dir

The directory where the virtualenv should reside.

Default: '/opt/patchwork/venv'

version

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'

source_repo

git repo URL for cloning patchwork. Useful for installing your own fork / patched version of patchwork.

Default: 'git://github.com/getpatchwork/patchwork'

user

User that owns patchwork files and runs the application.

Default 'patchwork'

group

Group that has access to patchwork files.

Default: 'patchwork'

manage_git

Installs git. Git is required for cloning patchwork.

Default: true

manage_python

Installs python, python development libraries, pip, and virtualenv. Required for creating the patchwork virtualenv and installing patchwork's dependencies.

Default: true

manage_database

Installs a local MySQL server.

Default: true

database_name

The name of the patchwork database.

Default: 'patchwork'

database_host

Database hostname of the client should connect to.

Databases created either through collect_exported or manage_database use $::ipaddress for the host.

Default: 'localhost'

database_user

The username for connection to the database.

Default: 'patchwork'

database_pass

The password associated with the database username.

Default: 'patchwork'

database_tag

Exported resource tag to for collecting the database resource onto a database server.

Default: 'mysql-patchwork'

uwsgi_overrides

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: {}

collect_exported

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

cron_minutes

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

patchwork::config

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.

secret_key

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

time_zone

A string representing the time zone for this installation.

See: TIME_ZONE

Default: 'Etc/UTC'

language_code

A string representing the language code for this installation.

See: LANGUAGE_CODE

Default: 'en_US'

patches_per_page

Number of patches listed on each page of a project's patch listing.

Default: '100'

force_https_links

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'

from_email

Sets the email address patch notifications, error messages, and validation emails come from.

See:

Default: 'Patchwork <patchwork@patchwork.example.com>'

admins

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' => 'admin@example.com',
}

See: ADMINS

Default: {}

allowed_hosts

A list of strings representing the host/domain names that this Django site can serve.

See: ALLOWED_HOSTS

Default: []

notification_delay

This should be set to the same as cron_minutes. Number of minutes patchwork should send Email notifications.

Default: 10 - Set by cron_minutes

enable_xmlrpc

Set to True to enable the Patchwork XML-RPC interface. This is needed for pwclient usage.

Default: 'False'

cache_backend

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'

cache_location

A list of strings providing the locations that implement the cache_backend.

See: LOCATION

Default: []

cache_timeout

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

cache_options

Set to True to enable the Patchwork XML-RPC interface. This is needed for pwclient usage.

See: OPTIONS

Default: {}

patchwork::selinux

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

module_source

Location of a patchwork selinux module to override the one provided by puppet.

Default: puppet:///module/patchwork/mypatchwork.te

Limitations

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.

Development

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

Release Notes/Changelog

Please see the CHANGELOG for a list of changes available in the current and previous releases.