Skip to content

Commit

Permalink
fixed typos in comments added some more types, config.pp -> private, …
Browse files Browse the repository at this point in the history
…removed remaining defaults
  • Loading branch information
danquack committed Oct 22, 2018
1 parent 22e3b3b commit 9ed57db
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 60 deletions.
57 changes: 22 additions & 35 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
_Public Classes_

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

_Private Classes_

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

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

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

Default value: $python::params::ensure

Expand Down Expand Up @@ -208,18 +207,6 @@ Data type: `Stdlib::Absolutepath`

Default value: $python::params::anaconda_install_path

### python::config

Optionally installs the gunicorn service

#### Examples

#####

```puppet
include python::config
```

## Defined types

### python::dotfile
Expand All @@ -237,8 +224,8 @@ python::dotfile { '/var/lib/jenkins/.pip/pip.conf':
group => 'jenkins',
config => {
'global' => {
'index-url => 'https://mypypi.acme.com/simple/'
'extra-index-url => https://pypi.risedev.at/simple/
'index-url => 'https://mypypi.acme.com/simple/'
'extra-index-url' => 'https://pypi.risedev.at/simple/'
}
}
}
Expand All @@ -250,39 +237,39 @@ The following parameters are available in the `python::dotfile` defined type.

##### `ensure`

Data type: `Any`
Data type: `Enum['absent', 'present']`


present|absent. Default: present

Default value: 'present'

##### `filename`

Data type: `Any`

Filename. Default: $title
Filename.

Default value: $title

##### `mode`

Data type: `Any`
Data type: `String`

File mode. Default: 0644
File mode.

Default value: '0644'

##### `owner`

Data type: `Any`
Data type: `String`

user owner of dotfile

Default value: 'root'

##### `group`

Data type: `Any`
Data type: `String`

group owner of dotfile

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

Data type: `Any`

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

Default value: {}

Expand Down Expand Up @@ -337,23 +324,23 @@ Default value: present

Data type: `Any`

Configure the gunicorn config directory path. Default: /etc/gunicorn.d
Configure the gunicorn config directory path.

Default value: '/etc/gunicorn.d'

##### `manage_config_dir`

Data type: `Any`

Set if the gunicorn config directory should be created. Default: false
Set if the gunicorn config directory should be created.

Default value: `false`

##### `virtualenv`

Data type: `Any`

Run in virtualenv, specify directory. Default: disabled
Run in virtualenv, specify directory.

Default value: `false`

Expand Down Expand Up @@ -387,7 +374,7 @@ Default value: `false`

Data type: `Any`

Set ENVIRONMENT variable. Default: none
Set ENVIRONMENT variable.

Default value: `false`

Expand Down Expand Up @@ -419,15 +406,15 @@ Default value: 30

Data type: `Any`

Which ERB template to use. Default: python/gunicorn.erb
Which ERB template to use.

Default value: 'python/gunicorn.erb'

##### `args`

Data type: `Any`

Custom arguments to add in gunicorn config file. Default: []
Custom arguments to add in gunicorn config file.

Default value: []

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

Data type: `Any`

Path to the requirements file. Defaults to the resource name
Path to the requirements file.

Default value: $name

##### `virtualenv`

Data type: `Any`

virtualenv to run pip in. Default: system-wide
virtualenv to run pip in.

Default value: 'system'

##### `pip_provider`

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

version of pip you wish to use. Default: pip
version of pip you wish to use.

Default value: 'pip'

Expand Down Expand Up @@ -951,7 +938,7 @@ Default value: `false`

Data type: `Any`

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

Default value: `false`

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

Data type: `Any`

reate $venv_dir
Create $venv_dir

Default value: `true`

Expand Down
2 changes: 1 addition & 1 deletion manifests/config.pp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#
# @api private
# @summary Optionally installs the gunicorn service
#
# @example
Expand Down
24 changes: 12 additions & 12 deletions manifests/dotfile.pp
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#
# @summary Manages any python dotfiles with a simple config hash.
#
# @param ensure present|absent. Default: present
# @param filename Filename. Default: $title
# @param mode File mode. Default: 0644
# @param ensure
# @param filename Filename.
# @param mode File mode.
# @param owner user owner of dotfile
# @param group group owner of dotfile
# @param config Config hash. This will be expanded to an ini-file. Default: {}
# @param config Config hash. This will be expanded to an ini-file.
#
# === Examples
#
Expand All @@ -17,20 +17,20 @@
# group => 'jenkins',
# config => {
# 'global' => {
# 'index-url => 'https://mypypi.acme.com/simple/'
# 'extra-index-url => https://pypi.risedev.at/simple/
# 'index-url => 'https://mypypi.acme.com/simple/'
# 'extra-index-url' => 'https://pypi.risedev.at/simple/'
# }
# }
# }
#
#
define python::dotfile (
$ensure = 'present',
$filename = $title,
$owner = 'root',
$group = 'root',
$mode = '0644',
$config = {},
Enum['absent', 'present'] $ensure = 'present',
$filename = $title,
String $owner = 'root',
String $group = 'root',
String $mode = '0644',
$config = {},
) {
$parent_dir = dirname($filename)

Expand Down
12 changes: 6 additions & 6 deletions manifests/gunicorn.pp
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@
# @summary Manages Gunicorn virtual hosts.
#
# @param ensure
# @param config_dir Configure the gunicorn config directory path. Default: /etc/gunicorn.d
# @param manage_config_dir Set if the gunicorn config directory should be created. Default: false
# @param virtualenv Run in virtualenv, specify directory. Default: disabled
# @param config_dir Configure the gunicorn config directory path.
# @param manage_config_dir Set if the gunicorn config directory should be created.
# @param virtualenv Run in virtualenv, specify directory.
# @param mode Gunicorn mode.
# @param dir Application directory.
# @param bind Bind on: 'HOST', 'HOST:PORT', 'unix:PATH'.
# Default: system-wide: unix:/tmp/gunicorn-$name.socket
# virtualenv: unix:${virtualenv}/${name}.socket
# @param environment Set ENVIRONMENT variable. Default: none
# @param environment Set ENVIRONMENT variable.
# @param appmodule Set the application module name for gunicorn to load when not using Django.
# @param osenv Allows setting environment variables for the gunicorn service. Accepts a hash of 'key': 'value' pairs.
# @param timeout Allows setting the gunicorn idle worker process time before being killed. The unit of time is seconds.
# @param template Which ERB template to use. Default: python/gunicorn.erb
# @param args Custom arguments to add in gunicorn config file. Default: []
# @param template Which ERB template to use.
# @param args Custom arguments to add in gunicorn config file.
#
# @example run gunicorn on vhost in virtualenv /var/www/project1
# python::gunicorn { 'vhost':
Expand Down
1 change: 0 additions & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# @summary Installs and manages python, python-dev, python-virtualenv and gunicorn.
#
# @param ensure Desired installation state for the Python package.
# Allowed values: absent, present and latest
# @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.
# Allowed values:
# - provider == pip: everything pip allows as a version after the 'python=='
Expand Down
6 changes: 3 additions & 3 deletions manifests/requirements.pp
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#
# @summary Installs and manages Python packages from requirements file.
#
# @param requirements Path to the requirements file. Defaults to the resource name
# @param virtualenv virtualenv to run pip in. Default: system-wide
# @param pip_provider version of pip you wish to use. Default: pip
# @param requirements Path to the requirements file.
# @param virtualenv virtualenv to run pip in.
# @param pip_provider version of pip you wish to use.
# @param owner The owner of the virtualenv being manipulated.
# @param group The group relating to the virtualenv being manipulated.
# @param proxy Proxy server to use for outbound connections.
Expand Down
4 changes: 2 additions & 2 deletions manifests/virtualenv.pp
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
# @param ensure
# @param version Python version to use.
# @param requirements Path to pip requirements.txt file
# @param systempkgs Copy system site-packages into virtualenv. Default: don't If virtualenv version < 1.7 this flag has no effect since
# @param systempkgs Copy system site-packages into virtualenv.
# @param venv_dir Directory to install virtualenv to
# @param ensure_venv_dir reate $venv_dir
# @param ensure_venv_dir Create $venv_dir
# @param distribute Include distribute in the virtualenv
# @param index Base URL of Python package index
# @param owner The owner of the virtualenv being manipulated
Expand Down

0 comments on commit 9ed57db

Please sign in to comment.