Skip to content

Commit 22e3b3b

Browse files
committed
Removed default comments, install/param -> private, typed mode/dev vars
1 parent 0faf83a commit 22e3b3b

File tree

6 files changed

+50
-83
lines changed

6 files changed

+50
-83
lines changed

REFERENCE.md

+18-40
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,15 @@
55

66
**Classes**
77

8+
_Public Classes_
9+
810
* [`python`](#python): Installs and manages python, python-dev, python-virtualenv and gunicorn.
911
* [`python::config`](#pythonconfig): Optionally installs the gunicorn service
10-
* [`python::install`](#pythoninstall): Installs core python packages
11-
* [`python::params`](#pythonparams): The python Module default configuration settings.
12+
13+
_Private Classes_
14+
15+
* `python::install`: Installs core python packages
16+
* `python::params`: The python Module default configuration settings.
1217

1318
**Defined types**
1419

@@ -71,43 +76,39 @@ Default value: $python::params::version
7176

7277
Data type: `Enum['absent', 'present', 'latest']`
7378

74-
Desired installation state for python-pip. Boolean values are deprecated.
75-
Allowed values: 'absent', 'present', 'latest'
79+
Desired installation state for python-pip.
7680

7781
Default value: $python::params::pip
7882

7983
##### `dev`
8084

81-
Data type: `Any`
85+
Data type: `Enum['absent', 'present', 'latest']`
8286

83-
Desired installation state for python-dev. Boolean values are deprecated.
84-
Allowed values: 'absent', 'present', 'latest'
87+
Desired installation state for python-dev.
8588

8689
Default value: $python::params::dev
8790

8891
##### `virtualenv`
8992

9093
Data type: `Enum['absent', 'present', 'latest']`
9194

92-
Desired installation state for python-virtualenv. Boolean values are deprecated
93-
Allowed values: 'absent', 'present', 'latest
95+
Desired installation state for python-virtualenv.
9496

9597
Default value: $python::params::virtualenv
9698

9799
##### `gunicorn`
98100

99101
Data type: `Enum['absent', 'present', 'latest']`
100102

101-
Desired installation state for Gunicorn. Boolean values are deprecated.
102-
Allowed values: 'absent', 'present', 'latest'
103+
Desired installation state for Gunicorn.
103104

104105
Default value: $python::params::gunicorn
105106

106107
##### `manage_gunicorn`
107108

108109
Data type: `Boolean`
109110

110-
Allow Installation / Removal of Gunicorn. Default: true
111+
Allow Installation / Removal of Gunicorn.
111112

112113
Default value: $python::params::manage_gunicorn
113114

@@ -116,7 +117,6 @@ Default value: $python::params::manage_gunicorn
116117
Data type: `Optional[Enum['pip', 'scl', 'rhscl', 'anaconda', '']]`
117118

118119
What provider to use for installation of the packages, except gunicorn and Python itself.
119-
Allowed values: 'pip'
120120

121121
Default value: $python::params::provider
122122

@@ -220,22 +220,6 @@ Optionally installs the gunicorn service
220220
include python::config
221221
```
222222

223-
### python::install
224-
225-
Installs core python packages
226-
227-
#### Examples
228-
229-
#####
230-
231-
```puppet
232-
include python::install
233-
```
234-
235-
### python::params
236-
237-
The python Module default configuration settings.
238-
239223
## Defined types
240224

241225
### python::dotfile
@@ -375,10 +359,9 @@ Default value: `false`
375359

376360
##### `mode`
377361

378-
Data type: `Any`
362+
Data type: `Enum['wsgi', 'django']`
379363

380364
Gunicorn mode.
381-
wsgi|django. Default: wsgi
382365

383366
Default value: 'wsgi'
384367

@@ -413,27 +396,22 @@ Default value: `false`
413396
Data type: `Any`
414397

415398
Set the application module name for gunicorn to load when not using Django.
416-
Default: app:app
417399

418400
Default value: 'app:app'
419401

420402
##### `osenv`
421403

422404
Data type: `Any`
423405

424-
Allows setting environment variables for the gunicorn service. Accepts a
425-
hash of 'key': 'value' pairs.
426-
Default: false
406+
Allows setting environment variables for the gunicorn service. Accepts a hash of 'key': 'value' pairs.
427407

428408
Default value: `false`
429409

430410
##### `timeout`
431411

432412
Data type: `Any`
433413

434-
Allows setting the gunicorn idle worker process time before being killed.
435-
The unit of time is seconds.
436-
Default: 30
414+
Allows setting the gunicorn idle worker process time before being killed. The unit of time is seconds.
437415

438416
Default value: 30
439417

@@ -723,7 +701,7 @@ Default value: present
723701

724702
Data type: `Any`
725703

726-
Python version to use. Default: system default
704+
Python version to use.
727705

728706
Default value: 'system'
729707

@@ -771,7 +749,7 @@ Default value: '0755'
771749

772750
Data type: `Any`
773751

774-
Specifies the PATH variable. Default: [ '/bin', '/usr/bin', '/usr/sbin' ]
752+
Specifies the PATH variable.
775753

776754
Default value: [ '/bin', '/usr/bin', '/usr/sbin', '/usr/local/bin' ]
777755

manifests/gunicorn.pp

+22-28
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,14 @@
66
# @param manage_config_dir Set if the gunicorn config directory should be created. Default: false
77
# @param virtualenv Run in virtualenv, specify directory. Default: disabled
88
# @param mode Gunicorn mode.
9-
# wsgi|django. Default: wsgi
109
# @param dir Application directory.
1110
# @param bind Bind on: 'HOST', 'HOST:PORT', 'unix:PATH'.
1211
# Default: system-wide: unix:/tmp/gunicorn-$name.socket
1312
# virtualenv: unix:${virtualenv}/${name}.socket
1413
# @param environment Set ENVIRONMENT variable. Default: none
1514
# @param appmodule Set the application module name for gunicorn to load when not using Django.
16-
# Default: app:app
17-
# @param osenv Allows setting environment variables for the gunicorn service. Accepts a
18-
# hash of 'key': 'value' pairs.
19-
# Default: false
20-
# @param timeout Allows setting the gunicorn idle worker process time before being killed.
21-
# The unit of time is seconds.
22-
# Default: 30
15+
# @param osenv Allows setting environment variables for the gunicorn service. Accepts a hash of 'key': 'value' pairs.
16+
# @param timeout Allows setting the gunicorn idle worker process time before being killed. The unit of time is seconds.
2317
# @param template Which ERB template to use. Default: python/gunicorn.erb
2418
# @param args Custom arguments to add in gunicorn config file. Default: []
2519
#
@@ -40,26 +34,26 @@
4034
# }
4135
#
4236
define python::gunicorn (
43-
$ensure = present,
44-
$config_dir = '/etc/gunicorn.d',
45-
$manage_config_dir = false,
46-
$virtualenv = false,
47-
$mode = 'wsgi',
48-
$dir = false,
49-
$bind = false,
50-
$environment = false,
51-
$owner = 'www-data',
52-
$group = 'www-data',
53-
$appmodule = 'app:app',
54-
$osenv = false,
55-
$timeout = 30,
56-
$workers = false,
57-
$access_log_format = false,
58-
$accesslog = false,
59-
$errorlog = false,
60-
$log_level = 'error',
61-
$template = 'python/gunicorn.erb',
62-
$args = [],
37+
$ensure = present,
38+
$config_dir = '/etc/gunicorn.d',
39+
$manage_config_dir = false,
40+
$virtualenv = false,
41+
Enum['wsgi', 'django'] $mode = 'wsgi',
42+
$dir = false,
43+
$bind = false,
44+
$environment = false,
45+
$owner = 'www-data',
46+
$group = 'www-data',
47+
$appmodule = 'app:app',
48+
$osenv = false,
49+
$timeout = 30,
50+
$workers = false,
51+
$access_log_format = false,
52+
$accesslog = false,
53+
$errorlog = false,
54+
$log_level = 'error',
55+
$template = 'python/gunicorn.erb',
56+
$args = [],
6357
) {
6458

6559
# Parameter validation

manifests/init.pp

+6-11
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,12 @@
1010
# - 'pypy' actually lets us use pypy as python.
1111
# - 3/3.3/... means you are going to install the python3/python3.3/...
1212
# package, if available on your osfamily.
13-
# @param pip Desired installation state for python-pip. Boolean values are deprecated.
14-
# Allowed values: 'absent', 'present', 'latest'
15-
# @param dev Desired installation state for python-dev. Boolean values are deprecated.
16-
# Allowed values: 'absent', 'present', 'latest'
17-
# @param virtualenv Desired installation state for python-virtualenv. Boolean values are deprecated
18-
# Allowed values: 'absent', 'present', 'latest
19-
# @param gunicorn Desired installation state for Gunicorn. Boolean values are deprecated.
20-
# Allowed values: 'absent', 'present', 'latest'
21-
# @param manage_gunicorn Allow Installation / Removal of Gunicorn. Default: true
13+
# @param pip Desired installation state for python-pip.
14+
# @param dev Desired installation state for python-dev.
15+
# @param virtualenv Desired installation state for python-virtualenv.
16+
# @param gunicorn Desired installation state for Gunicorn.
17+
# @param manage_gunicorn Allow Installation / Removal of Gunicorn.
2218
# @param provider What provider to use for installation of the packages, except gunicorn and Python itself.
23-
# Allowed values: 'pip'
2419
# @param use_epel to determine if the epel class is used.
2520
#
2621
# @example ensure system python is installed, with pip,dev, virtualenv, and gunicorn packages present
@@ -36,7 +31,7 @@
3631
Enum['absent', 'present', 'latest'] $ensure = $python::params::ensure,
3732
$version = $python::params::version,
3833
Enum['absent', 'present', 'latest'] $pip = $python::params::pip,
39-
$dev = $python::params::dev,
34+
Enum['absent', 'present', 'latest'] $dev = $python::params::dev,
4035
Enum['absent', 'present', 'latest'] $virtualenv = $python::params::virtualenv,
4136
Enum['absent', 'present', 'latest'] $gunicorn = $python::params::gunicorn,
4237
Boolean $manage_gunicorn = $python::params::manage_gunicorn,

manifests/install.pp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#
1+
# @api private
22
# @summary Installs core python packages
33
#
44
# @example

manifests/params.pp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#
1+
# @api private
22
# @summary The python Module default configuration settings.
33
#
44
class python::params {

manifests/pyvenv.pp

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
# @summary Create a Python3 virtualenv using pyvenv.
33
#
44
# @param ensure
5-
# @param version Python version to use. Default: system default
5+
# @param version Python version to use.
66
# @param systempkgs Copy system site-packages into virtualenv
77
# @param venv_dir Directory to install virtualenv to
88
# @param owner The owner of the virtualenv being manipulated
99
# @param group The group relating to the virtualenv being manipulated
1010
# @param mode Optionally specify directory mode
11-
# @param path Specifies the PATH variable. Default: [ '/bin', '/usr/bin', '/usr/sbin' ]
11+
# @param path Specifies the PATH variable.
1212
# @param environment Optionally specify environment variables for pyvenv
1313
#
1414
# @example

0 commit comments

Comments
 (0)