Skip to content

Commit 8dd4a72

Browse files
committed
Udate forge reference.md documentation for remaning manifest files
1 parent 8bb994c commit 8dd4a72

10 files changed

+330
-702
lines changed

REFERENCE.md

+188-342
Large diffs are not rendered by default.

manifests/config.pp

+3-12
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,9 @@
1-
# == Define: python::config
21
#
3-
# Optionally installs the gunicorn service
2+
# @summary Optionally installs the gunicorn service
43
#
5-
# === Examples
4+
# @example
5+
# include python::config
66
#
7-
# include python::config
8-
#
9-
# === Authors
10-
#
11-
# Sergey Stankevich
12-
# Ashley Penney
13-
# Fotis Gimian
14-
#
15-
167
class python::config {
178

189
Class['python::install'] -> Python::Pip <| |>

manifests/dotfile.pp

+17-28
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,27 @@
1-
# == Define: python::dotfile
21
#
3-
# Manages any python dotfiles with a simple config hash.
2+
# @summary Manages any python dotfiles with a simple config hash.
43
#
5-
# === Parameters
6-
#
7-
# [*ensure*]
8-
# present|absent. Default: present
9-
#
10-
# [*filename*]
11-
# Filename. Default: $title
12-
#
13-
# [*mode*]
14-
# File mode. Default: 0644
15-
#
16-
# [*owner*]
17-
# [*group*]
18-
# Owner/group. Default: `root`/`root`
19-
#
20-
# [*config*]
21-
# Config hash. This will be expanded to an ini-file. Default: {}
4+
# @param ensure present|absent. Default: present
5+
# @param filename Filename. Default: $title
6+
# @param mode File mode. Default: 0644
7+
# @param owner user owner of dotfile
8+
# @param group group owner of dotfile
9+
# @param config Config hash. This will be expanded to an ini-file. Default: {}
2210
#
2311
# === Examples
2412
#
25-
# python::dotfile { '/var/lib/jenkins/.pip/pip.conf':
26-
# ensure => present,
27-
# owner => 'jenkins',
28-
# group => 'jenkins',
29-
# config => {
30-
# 'global' => {
31-
# 'index-url => 'https://mypypi.acme.com/simple/'
32-
# 'extra-index-url => https://pypi.risedev.at/simple/
13+
# @example Create a pip config in /var/lib/jenkins/.pip/
14+
# python::dotfile { '/var/lib/jenkins/.pip/pip.conf':
15+
# ensure => present,
16+
# owner => 'jenkins',
17+
# group => 'jenkins',
18+
# config => {
19+
# 'global' => {
20+
# 'index-url => 'https://mypypi.acme.com/simple/'
21+
# 'extra-index-url => https://pypi.risedev.at/simple/
22+
# }
3323
# }
3424
# }
35-
# }
3625
#
3726
#
3827
define python::dotfile (

manifests/gunicorn.pp

+30-65
Original file line numberDiff line numberDiff line change
@@ -1,78 +1,43 @@
1-
# == Define: python::gunicorn
21
#
3-
# Manages Gunicorn virtual hosts.
2+
# @summary Manages Gunicorn virtual hosts.
43
#
5-
# === Parameters
6-
#
7-
# [*ensure*]
8-
# present|absent. Default: present
9-
#
10-
# [*config_dir*]
11-
# Configure the gunicorn config directory path. Default: /etc/gunicorn.d
12-
#
13-
# [*manage_config_dir*]
14-
# Set if the gunicorn config directory should be created. Default: false
15-
#
16-
# [*virtualenv*]
17-
# Run in virtualenv, specify directory. Default: disabled
18-
#
19-
# [*mode*]
20-
# Gunicorn mode.
4+
# @param ensure
5+
# @param config_dir Configure the gunicorn config directory path. Default: /etc/gunicorn.d
6+
# @param manage_config_dir Set if the gunicorn config directory should be created. Default: false
7+
# @param virtualenv Run in virtualenv, specify directory. Default: disabled
8+
# @param mode Gunicorn mode.
219
# wsgi|django. Default: wsgi
22-
#
23-
# [*dir*]
24-
# Application directory.
25-
#
26-
# [*bind*]
27-
# Bind on: 'HOST', 'HOST:PORT', 'unix:PATH'.
10+
# @param dir Application directory.
11+
# @param bind Bind on: 'HOST', 'HOST:PORT', 'unix:PATH'.
2812
# Default: system-wide: unix:/tmp/gunicorn-$name.socket
2913
# virtualenv: unix:${virtualenv}/${name}.socket
30-
#
31-
# [*environment*]
32-
# Set ENVIRONMENT variable. Default: none
33-
#
34-
# [*appmodule*]
35-
# Set the application module name for gunicorn to load when not using Django.
14+
# @param environment Set ENVIRONMENT variable. Default: none
15+
# @param appmodule Set the application module name for gunicorn to load when not using Django.
3616
# Default: app:app
37-
#
38-
# [*osenv*]
39-
# Allows setting environment variables for the gunicorn service. Accepts a
17+
# @param osenv Allows setting environment variables for the gunicorn service. Accepts a
4018
# hash of 'key': 'value' pairs.
4119
# Default: false
42-
#
43-
# [*timeout*]
44-
# Allows setting the gunicorn idle worker process time before being killed.
20+
# @param timeout Allows setting the gunicorn idle worker process time before being killed.
4521
# The unit of time is seconds.
4622
# Default: 30
47-
#
48-
# [*template*]
49-
# Which ERB template to use. Default: python/gunicorn.erb
50-
#
51-
# [*args*]
52-
# Custom arguments to add in gunicorn config file. Default: []
53-
#
54-
# === Examples
55-
#
56-
# python::gunicorn { 'vhost':
57-
# ensure => present,
58-
# virtualenv => '/var/www/project1',
59-
# mode => 'wsgi',
60-
# dir => '/var/www/project1/current',
61-
# bind => 'unix:/tmp/gunicorn.socket',
62-
# environment => 'prod',
63-
# owner => 'www-data',
64-
# group => 'www-data',
65-
# appmodule => 'app:app',
66-
# osenv => { 'DBHOST' => 'dbserver.example.com' },
67-
# timeout => 30,
68-
# template => 'python/gunicorn.erb',
69-
# }
70-
#
71-
# === Authors
72-
#
73-
# Sergey Stankevich
74-
# Ashley Penney
75-
# Marc Fournier
23+
# @param template Which ERB template to use. Default: python/gunicorn.erb
24+
# @param args Custom arguments to add in gunicorn config file. Default: []
25+
#
26+
# @example run gunicorn on vhost in virtualenv /var/www/project1
27+
# python::gunicorn { 'vhost':
28+
# ensure => present,
29+
# virtualenv => '/var/www/project1',
30+
# mode => 'wsgi',
31+
# dir => '/var/www/project1/current',
32+
# bind => 'unix:/tmp/gunicorn.socket',
33+
# environment => 'prod',
34+
# owner => 'www-data',
35+
# group => 'www-data',
36+
# appmodule => 'app:app',
37+
# osenv => { 'DBHOST' => 'dbserver.example.com' },
38+
# timeout => 30,
39+
# template => 'python/gunicorn.erb',
40+
# }
7641
#
7742
define python::gunicorn (
7843
$ensure = present,

manifests/init.pp

+19-54
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,37 @@
1-
# == Class: python
1+
# @summary Installs and manages python, python-dev, python-virtualenv and gunicorn.
22
#
3-
# Installs and manages python, python-dev, python-virtualenv and Gunicorn.
4-
#
5-
# === Parameters
6-
#
7-
# [*ensure*]
8-
# Desired installation state for the Python package. Valid options are absent,
9-
# present and latest. Default: present
10-
#
11-
# [*version*]
12-
# Python version to install. Beware that valid values for this differ a) by
13-
# the provider you choose and b) by the osfamily/operatingsystem you are using.
14-
# Default: system default
3+
# @param ensure Desired installation state for the Python package.
4+
# Allowed values: absent, present and latest
5+
# @param version Python version to install. Beware that valid values for this differ a) by the provider you choose and b) by the osfamily/operatingsystem you are using.
156
# Allowed values:
167
# - provider == pip: everything pip allows as a version after the 'python=='
178
# - else: 'system', 'pypy', 3/3.3/...
189
# - Be aware that 'system' usually means python 2.X.
1910
# - 'pypy' actually lets us use pypy as python.
2011
# - 3/3.3/... means you are going to install the python3/python3.3/...
2112
# package, if available on your osfamily.
22-
#
23-
# [*pip*]
24-
# Desired installation state for python-pip. Boolean values are deprecated.
25-
# Default: present
13+
# @param pip Desired installation state for python-pip. Boolean values are deprecated.
2614
# Allowed values: 'absent', 'present', 'latest'
27-
#
28-
# [*dev*]
29-
# Desired installation state for python-dev. Boolean values are deprecated.
30-
# Default: absent
15+
# @param dev Desired installation state for python-dev. Boolean values are deprecated.
3116
# Allowed values: 'absent', 'present', 'latest'
32-
#
33-
# [*virtualenv*]
34-
# Desired installation state for python-virtualenv. Boolean values are
35-
# deprecated. Default: absent
17+
# @param virtualenv Desired installation state for python-virtualenv. Boolean values are deprecated
3618
# Allowed values: 'absent', 'present', 'latest
37-
#
38-
# [*gunicorn*]
39-
# Desired installation state for Gunicorn. Boolean values are deprecated.
40-
# Default: absent
19+
# @param gunicorn Desired installation state for Gunicorn. Boolean values are deprecated.
4120
# Allowed values: 'absent', 'present', 'latest'
42-
#
43-
# [*manage_gunicorn*]
44-
# Allow Installation / Removal of Gunicorn. Default: true
45-
#
46-
# [*provider*]
47-
# What provider to use for installation of the packages, except gunicorn and
48-
# Python itself. Default: system default provider
21+
# @param manage_gunicorn Allow Installation / Removal of Gunicorn. Default: true
22+
# @param provider What provider to use for installation of the packages, except gunicorn and Python itself.
4923
# Allowed values: 'pip'
24+
# @param use_epel to determine if the epel class is used.
5025
#
51-
# [*use_epel*]
52-
# Boolean to determine if the epel class is used. Default: true
53-
#
54-
# === Examples
55-
#
56-
# class { 'python':
57-
# version => 'system',
58-
# pip => 'present',
59-
# dev => 'present',
60-
# virtualenv => 'present',
61-
# gunicorn => 'present',
62-
# }
26+
# @example ensure system python is installed, with pip,dev, virtualenv, and gunicorn packages present
27+
# class { 'python':
28+
# version => 'system',
29+
# pip => 'present',
30+
# dev => 'present',
31+
# virtualenv => 'present',
32+
# gunicorn => 'present',
33+
# }
6334
#
64-
# === Authors
65-
#
66-
# Sergey Stankevich
67-
# Garrett Honeycutt <[email protected]>
68-
#
69-
7035
class python (
7136
Enum['absent', 'present', 'latest'] $ensure = $python::params::ensure,
7237
$version = $python::params::version,

manifests/install.pp

+3-12
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,8 @@
1-
# == Class: python::install
21
#
3-
# Installs core python packages,
2+
# @summary Installs core python packages
43
#
5-
# === Examples
6-
#
7-
# include python::install
8-
#
9-
# === Authors
10-
#
11-
# Sergey Stankevich
12-
# Ashley Penney
13-
# Fotis Gimian
14-
# Garrett Honeycutt <[email protected]>
4+
# @example
5+
# include python::install
156
#
167
class python::install {
178

manifests/params.pp

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
# == Class: python::params
21
#
3-
# The python Module default configuration settings.
2+
# @summary The python Module default configuration settings.
43
#
54
class python::params {
65
$ensure = 'present'

manifests/pyvenv.pp

+16-45
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,22 @@
1-
# == Define: python::pyvenv
21
#
3-
# Create a Python3 virtualenv using pyvenv.
4-
#
5-
# === Parameters
6-
#
7-
# [*ensure*]
8-
# present|absent. Default: present
9-
#
10-
# [*version*]
11-
# Python version to use. Default: system default
12-
#
13-
# [*systempkgs*]
14-
# Copy system site-packages into virtualenv. Default: don't
15-
#
16-
# [*venv_dir*]
17-
# Directory to install virtualenv to. Default: $name
18-
#
19-
# [*owner*]
20-
# The owner of the virtualenv being manipulated. Default: root
21-
#
22-
# [*group*]
23-
# The group relating to the virtualenv being manipulated. Default: root
24-
#
25-
# [*mode*]
26-
# Optionally specify directory mode. Default: 0755
27-
#
28-
# [*path*]
29-
# Specifies the PATH variable. Default: [ '/bin', '/usr/bin', '/usr/sbin' ]
2+
# @summary Create a Python3 virtualenv using pyvenv.
303

31-
# [*environment*]
32-
# Optionally specify environment variables for pyvenv
33-
#
34-
# === Examples
35-
#
36-
# python::venv { '/var/www/project1':
37-
# ensure => present,
38-
# version => 'system',
39-
# systempkgs => true,
40-
# }
41-
#
42-
# === Authors
4+
# @param ensure
5+
# @param version Python version to use. Default: system default
6+
# @param systempkgs Copy system site-packages into virtualenv
7+
# @param venv_dir Directory to install virtualenv to
8+
# @param owner The owner of the virtualenv being manipulated
9+
# @param group The group relating to the virtualenv being manipulated
10+
# @param mode Optionally specify directory mode
11+
# @param path Specifies the PATH variable. Default: [ '/bin', '/usr/bin', '/usr/sbin' ]
12+
# @param environment Optionally specify environment variables for pyvenv
4313
#
44-
# Sergey Stankevich
45-
# Ashley Penney
46-
# Marc Fournier
47-
# Fotis Gimian
48-
# Seth Cleveland
14+
# @example
15+
# python::venv { '/var/www/project1':
16+
# ensure => present,
17+
# version => 'system',
18+
# systempkgs => true,
19+
# }
4920
#
5021
define python::pyvenv (
5122
$ensure = present,

0 commit comments

Comments
 (0)