Skip to content

Commit e63659e

Browse files
committed
fixed typos in comments added some more types, config.pp -> private, removed remaining defaults
1 parent 22e3b3b commit e63659e

File tree

7 files changed

+46
-60
lines changed

7 files changed

+46
-60
lines changed

REFERENCE.md

+22-35
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
_Public Classes_
99

1010
* [`python`](#python): Installs and manages python, python-dev, python-virtualenv and gunicorn.
11-
* [`python::config`](#pythonconfig): Optionally installs the gunicorn service
1211

1312
_Private Classes_
1413

14+
* `python::config`: Optionally installs the gunicorn service
1515
* `python::install`: Installs core python packages
1616
* `python::params`: The python Module default configuration settings.
1717

@@ -53,7 +53,6 @@ The following parameters are available in the `python` class.
5353
Data type: `Enum['absent', 'present', 'latest']`
5454

5555
Desired installation state for the Python package.
56-
Allowed values: absent, present and latest
5756

5857
Default value: $python::params::ensure
5958

@@ -208,18 +207,6 @@ Data type: `Stdlib::Absolutepath`
208207

209208
Default value: $python::params::anaconda_install_path
210209

211-
### python::config
212-
213-
Optionally installs the gunicorn service
214-
215-
#### Examples
216-
217-
#####
218-
219-
```puppet
220-
include python::config
221-
```
222-
223210
## Defined types
224211

225212
### python::dotfile
@@ -237,8 +224,8 @@ python::dotfile { '/var/lib/jenkins/.pip/pip.conf':
237224
group => 'jenkins',
238225
config => {
239226
'global' => {
240-
'index-url => 'https://mypypi.acme.com/simple/'
241-
'extra-index-url => https://pypi.risedev.at/simple/
227+
'index-url' => 'https://mypypi.acme.com/simple/'
228+
'extra-index-url' => 'https://pypi.risedev.at/simple/'
242229
}
243230
}
244231
}
@@ -250,39 +237,39 @@ The following parameters are available in the `python::dotfile` defined type.
250237

251238
##### `ensure`
252239

253-
Data type: `Any`
240+
Data type: `Enum['absent', 'present']`
241+
254242

255-
present|absent. Default: present
256243

257244
Default value: 'present'
258245

259246
##### `filename`
260247

261248
Data type: `Any`
262249

263-
Filename. Default: $title
250+
Filename.
264251

265252
Default value: $title
266253

267254
##### `mode`
268255

269-
Data type: `Any`
256+
Data type: `String`
270257

271-
File mode. Default: 0644
258+
File mode.
272259

273260
Default value: '0644'
274261

275262
##### `owner`
276263

277-
Data type: `Any`
264+
Data type: `String`
278265

279266
user owner of dotfile
280267

281268
Default value: 'root'
282269

283270
##### `group`
284271

285-
Data type: `Any`
272+
Data type: `String`
286273

287274
group owner of dotfile
288275

@@ -292,7 +279,7 @@ Default value: 'root'
292279

293280
Data type: `Any`
294281

295-
Config hash. This will be expanded to an ini-file. Default: {}
282+
Config hash. This will be expanded to an ini-file.
296283

297284
Default value: {}
298285

@@ -337,23 +324,23 @@ Default value: present
337324

338325
Data type: `Any`
339326

340-
Configure the gunicorn config directory path. Default: /etc/gunicorn.d
327+
Configure the gunicorn config directory path.
341328

342329
Default value: '/etc/gunicorn.d'
343330

344331
##### `manage_config_dir`
345332

346333
Data type: `Any`
347334

348-
Set if the gunicorn config directory should be created. Default: false
335+
Set if the gunicorn config directory should be created.
349336

350337
Default value: `false`
351338

352339
##### `virtualenv`
353340

354341
Data type: `Any`
355342

356-
Run in virtualenv, specify directory. Default: disabled
343+
Run in virtualenv, specify directory.
357344

358345
Default value: `false`
359346

@@ -387,7 +374,7 @@ Default value: `false`
387374

388375
Data type: `Any`
389376

390-
Set ENVIRONMENT variable. Default: none
377+
Set ENVIRONMENT variable.
391378

392379
Default value: `false`
393380

@@ -419,15 +406,15 @@ Default value: 30
419406

420407
Data type: `Any`
421408

422-
Which ERB template to use. Default: python/gunicorn.erb
409+
Which ERB template to use.
423410

424411
Default value: 'python/gunicorn.erb'
425412

426413
##### `args`
427414

428415
Data type: `Any`
429416

430-
Custom arguments to add in gunicorn config file. Default: []
417+
Custom arguments to add in gunicorn config file.
431418

432419
Default value: []
433420

@@ -784,23 +771,23 @@ The following parameters are available in the `python::requirements` defined typ
784771

785772
Data type: `Any`
786773

787-
Path to the requirements file. Defaults to the resource name
774+
Path to the requirements file.
788775

789776
Default value: $name
790777

791778
##### `virtualenv`
792779

793780
Data type: `Any`
794781

795-
virtualenv to run pip in. Default: system-wide
782+
virtualenv to run pip in.
796783

797784
Default value: 'system'
798785

799786
##### `pip_provider`
800787

801788
Data type: `Enum['pip', 'pip3']`
802789

803-
version of pip you wish to use. Default: pip
790+
version of pip you wish to use.
804791

805792
Default value: 'pip'
806793

@@ -951,7 +938,7 @@ Default value: `false`
951938

952939
Data type: `Any`
953940

954-
Copy system site-packages into virtualenv. Default: don't If virtualenv version < 1.7 this flag has no effect since
941+
Copy system site-packages into virtualenv.
955942

956943
Default value: `false`
957944

@@ -967,7 +954,7 @@ Default value: $name
967954

968955
Data type: `Any`
969956

970-
reate $venv_dir
957+
Create $venv_dir
971958

972959
Default value: `true`
973960

manifests/config.pp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#
1+
# @api private
22
# @summary Optionally installs the gunicorn service
33
#
44
# @example

manifests/dotfile.pp

+12-12
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
#
22
# @summary Manages any python dotfiles with a simple config hash.
33
#
4-
# @param ensure present|absent. Default: present
5-
# @param filename Filename. Default: $title
6-
# @param mode File mode. Default: 0644
4+
# @param ensure
5+
# @param filename Filename.
6+
# @param mode File mode.
77
# @param owner user owner of dotfile
88
# @param group group owner of dotfile
9-
# @param config Config hash. This will be expanded to an ini-file. Default: {}
9+
# @param config Config hash. This will be expanded to an ini-file.
1010
#
1111
# === Examples
1212
#
@@ -17,20 +17,20 @@
1717
# group => 'jenkins',
1818
# config => {
1919
# 'global' => {
20-
# 'index-url => 'https://mypypi.acme.com/simple/'
21-
# 'extra-index-url => https://pypi.risedev.at/simple/
20+
# 'index-url' => 'https://mypypi.acme.com/simple/'
21+
# 'extra-index-url' => 'https://pypi.risedev.at/simple/'
2222
# }
2323
# }
2424
# }
2525
#
2626
#
2727
define python::dotfile (
28-
$ensure = 'present',
29-
$filename = $title,
30-
$owner = 'root',
31-
$group = 'root',
32-
$mode = '0644',
33-
$config = {},
28+
Enum['absent', 'present'] $ensure = 'present',
29+
$filename = $title,
30+
String $owner = 'root',
31+
String $group = 'root',
32+
String $mode = '0644',
33+
$config = {},
3434
) {
3535
$parent_dir = dirname($filename)
3636

manifests/gunicorn.pp

+6-6
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,20 @@
22
# @summary Manages Gunicorn virtual hosts.
33
#
44
# @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
5+
# @param config_dir Configure the gunicorn config directory path.
6+
# @param manage_config_dir Set if the gunicorn config directory should be created.
7+
# @param virtualenv Run in virtualenv, specify directory.
88
# @param mode Gunicorn mode.
99
# @param dir Application directory.
1010
# @param bind Bind on: 'HOST', 'HOST:PORT', 'unix:PATH'.
1111
# Default: system-wide: unix:/tmp/gunicorn-$name.socket
1212
# virtualenv: unix:${virtualenv}/${name}.socket
13-
# @param environment Set ENVIRONMENT variable. Default: none
13+
# @param environment Set ENVIRONMENT variable.
1414
# @param appmodule Set the application module name for gunicorn to load when not using Django.
1515
# @param osenv Allows setting environment variables for the gunicorn service. Accepts a hash of 'key': 'value' pairs.
1616
# @param timeout Allows setting the gunicorn idle worker process time before being killed. The unit of time is seconds.
17-
# @param template Which ERB template to use. Default: python/gunicorn.erb
18-
# @param args Custom arguments to add in gunicorn config file. Default: []
17+
# @param template Which ERB template to use.
18+
# @param args Custom arguments to add in gunicorn config file.
1919
#
2020
# @example run gunicorn on vhost in virtualenv /var/www/project1
2121
# python::gunicorn { 'vhost':

manifests/init.pp

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# @summary Installs and manages python, python-dev, python-virtualenv and gunicorn.
22
#
33
# @param ensure Desired installation state for the Python package.
4-
# Allowed values: absent, present and latest
54
# @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.
65
# Allowed values:
76
# - provider == pip: everything pip allows as a version after the 'python=='

manifests/requirements.pp

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#
22
# @summary Installs and manages Python packages from requirements file.
33
#
4-
# @param requirements Path to the requirements file. Defaults to the resource name
5-
# @param virtualenv virtualenv to run pip in. Default: system-wide
6-
# @param pip_provider version of pip you wish to use. Default: pip
4+
# @param requirements Path to the requirements file.
5+
# @param virtualenv virtualenv to run pip in.
6+
# @param pip_provider version of pip you wish to use.
77
# @param owner The owner of the virtualenv being manipulated.
88
# @param group The group relating to the virtualenv being manipulated.
99
# @param proxy Proxy server to use for outbound connections.

manifests/virtualenv.pp

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
# @param ensure
55
# @param version Python version to use.
66
# @param requirements Path to pip requirements.txt file
7-
# @param systempkgs Copy system site-packages into virtualenv. Default: don't If virtualenv version < 1.7 this flag has no effect since
7+
# @param systempkgs Copy system site-packages into virtualenv.
88
# @param venv_dir Directory to install virtualenv to
9-
# @param ensure_venv_dir reate $venv_dir
9+
# @param ensure_venv_dir Create $venv_dir
1010
# @param distribute Include distribute in the virtualenv
1111
# @param index Base URL of Python package index
1212
# @param owner The owner of the virtualenv being manipulated

0 commit comments

Comments
 (0)