From 9ed57db5e4951c20b560bbd66c39a8740f70d095 Mon Sep 17 00:00:00 2001 From: Daniel Quackenbush Date: Mon, 22 Oct 2018 19:01:33 -0400 Subject: [PATCH] fixed typos in comments added some more types, config.pp -> private, removed remaining defaults --- REFERENCE.md | 57 +++++++++++++++------------------------ manifests/config.pp | 2 +- manifests/dotfile.pp | 24 ++++++++--------- manifests/gunicorn.pp | 12 ++++----- manifests/init.pp | 1 - manifests/requirements.pp | 6 ++--- manifests/virtualenv.pp | 4 +-- 7 files changed, 46 insertions(+), 60 deletions(-) diff --git a/REFERENCE.md b/REFERENCE.md index f3295d3b..85f7d023 100644 --- a/REFERENCE.md +++ b/REFERENCE.md @@ -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. @@ -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 @@ -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 @@ -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/' } } } @@ -250,9 +237,9 @@ 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' @@ -260,21 +247,21 @@ Default value: 'present' 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 @@ -282,7 +269,7 @@ Default value: 'root' ##### `group` -Data type: `Any` +Data type: `String` group owner of dotfile @@ -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: {} @@ -337,7 +324,7 @@ 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' @@ -345,7 +332,7 @@ Default value: '/etc/gunicorn.d' 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` @@ -353,7 +340,7 @@ Default value: `false` Data type: `Any` -Run in virtualenv, specify directory. Default: disabled +Run in virtualenv, specify directory. Default value: `false` @@ -387,7 +374,7 @@ Default value: `false` Data type: `Any` -Set ENVIRONMENT variable. Default: none +Set ENVIRONMENT variable. Default value: `false` @@ -419,7 +406,7 @@ 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' @@ -427,7 +414,7 @@ Default value: 'python/gunicorn.erb' Data type: `Any` -Custom arguments to add in gunicorn config file. Default: [] +Custom arguments to add in gunicorn config file. Default value: [] @@ -784,7 +771,7 @@ 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 @@ -792,7 +779,7 @@ Default value: $name Data type: `Any` -virtualenv to run pip in. Default: system-wide +virtualenv to run pip in. Default value: 'system' @@ -800,7 +787,7 @@ Default value: 'system' Data type: `Enum['pip', 'pip3']` -version of pip you wish to use. Default: pip +version of pip you wish to use. Default value: 'pip' @@ -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` @@ -967,7 +954,7 @@ Default value: $name Data type: `Any` -reate $venv_dir +Create $venv_dir Default value: `true` diff --git a/manifests/config.pp b/manifests/config.pp index 9788838d..73a346d7 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -1,4 +1,4 @@ -# +# @api private # @summary Optionally installs the gunicorn service # # @example diff --git a/manifests/dotfile.pp b/manifests/dotfile.pp index de1bd096..67e53e43 100644 --- a/manifests/dotfile.pp +++ b/manifests/dotfile.pp @@ -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 # @@ -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) diff --git a/manifests/gunicorn.pp b/manifests/gunicorn.pp index b6a9542c..994bf08c 100644 --- a/manifests/gunicorn.pp +++ b/manifests/gunicorn.pp @@ -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': diff --git a/manifests/init.pp b/manifests/init.pp index a0c5a8be..0a03faf8 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -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==' diff --git a/manifests/requirements.pp b/manifests/requirements.pp index 1127f5db..615b091b 100644 --- a/manifests/requirements.pp +++ b/manifests/requirements.pp @@ -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. diff --git a/manifests/virtualenv.pp b/manifests/virtualenv.pp index c1a06ffe..23c3a7d7 100644 --- a/manifests/virtualenv.pp +++ b/manifests/virtualenv.pp @@ -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