Version information
released Jul 4th 2019
This version is compatible with:
- Puppet Enterprise 2023.5.x, 2023.4.x, 2023.3.x, 2023.2.x, 2023.1.x, 2023.0.x, 2021.7.x, 2021.6.x, 2021.5.x, 2021.4.x, 2021.3.x, 2021.2.x, 2021.1.x, 2021.0.x, 2019.8.x, 2019.7.x, 2019.5.x, 2019.4.x, 2019.3.x, 2019.2.x, 2019.1.x, 2019.0.x, 2018.1.x, 2017.3.x
- Puppet >= 5.0
- , , ,
Start using this module
Add this module to your Puppetfile:
mod 'Siebjee-python', '0.2.3'
Learn more about managing modules with a PuppetfileDocumentation
Siebjee/python — version 0.2.3 Jul 4th 2019
Python
Table of contents
- Overview
- Module Description - What the module does and why it is useful
- Usage - Configuration options and additional functionality
- Reference - An under-the-hood peek at what the module is doing and how
- Limitations
Overview
This python module allows you to easely manage multiple python versions for a single user
Module Description
The python module provides a single module to manage pyenv
, pip
and virtualenv
for a single user. And completely ignores the system installed python.
Usage
To install pyenv and configure pip automatically to your local pip mirror.
class {'python':
python_versions => '1.2.3',
pip_url => 'https://url/to/pip',
}
To enable virtualenv for all versions installed you only have to specify virtualenv => true
.
class {'python':
versions => ['2.7.5','2.7.6']
pip_url => 'https://url/for/pip',
}
-> python::virtualenv {'/tmp/foobar':
python_version => '2.7.5'
}
-> python::pip {'pgadmin':
python_version => '2.7.5',
virtualenv => '/tmp/foobar',
install_dir => '/tmp/foobar',
pkgname => 'pgadmin4'
}
This can also be set through hiera:
python::versions:
- '2.7.5'
- '2.7.6'
- '2.7.7'
python::virtualenv: true
python::pip_url: 'https://path/to/pip'
or specify an hash
of versions
python::versions:
'2.7.5':
ensure: absent
'2.7.6':
ensure: present
virtualenv: false
'2.7.7':
ensure: present
virtualenv: true
With the above hiera values you can just specify
class {'python': }
Reference
class: python
pyenv_ensure
If the specified version should be present.- Values:
present
absent
. - Default
present
- Values:
virtualenv_ensure
If virtual env should be installed default.- Values
true
false
. - Default
true
- Values
pyenv_version
Which pyenv version should be installed.- Values
String
. - Default
1.2.5
- Values
pyenv_url
Where to get pyenv from.- Values
String
. - Default
https://github.com/pyenv/pyenv.git
- Values
user
The user pyenv should be installed for.- Values
String
. - Default
ec2-user
- Values
group
The group pyenv should be installed for.- Values
String
. - Default
ec2-user
- Values
pyenv_install_dir
Where to install pyenv.- Values:
String
. - Default
/home/$user/.pyenv
- Values:
pip_url
The pip url.- Values:
String
. - Default
https://pypi.org/simple
- Values:
python_versions
The python versions that should be installed.- Values
Hash
orArray
. - Default
empty
- Values
class: python::config
bashrc
The bash rc of the user- Value:
String
- Default:
/home/${hiera(python::user)}/.bashrc
- Value:
ensure
If the pyenv settings should be present.- Values
present
absent
. - Default
present
- Values
user
The user of the bashrc- Values:
String
. - Default
$python::user
- Values:
install_dir
Where pyenv is installed.- Value
String
. - Default
$python::pyenv_install_dir
- Value
class: python::virtualenv
ensure
If the virtualenv should be present.- Values
present
absent
. - Default
present
- Values
python_version
Which python version to use.- Required
- Value
String
user
The user pyenv is installed for.- Values:
String
. - Default
$python::user
- Values:
group
The group pyenv is installed for.- Values:
String
. - Default
$python::group
- Values:
runas
The user that runs the commnad.- Values
String
. - Default
$user
- Values
virtualenv
The virtualenv name.- Values
String
. - Default
$title
- Values
pyenv_root
Where pyenv is installed.- Values
String
. - Default
$python::pyenv_install_dir
- Values
class: python::pip
install_dir
Where to install the package.- Required
- Value
String
python_version
Which python version to use.- Required
- Value
String
pkgname
The package name.- Value
String
. - Default
$title
- Value
user
The owner of the package.- Value
String
. - Default
$python::user
- Value
group
The owner group of the package.- Value
String
. - Default
$python::group
- Value
runas
The user pip should un as.- Value
String
. - Default
$user
- Value
pyenv_root
Where pyenv is installed.- Value
String
. - Default
$python::pyenv_install_dir
- Value
requirements
To install the requirements.- Value
String
. - Default
undef
- Value
virtualenv
Which virtualenv to use.- Value
String
. - Default
undef
- Value
Limitations
Only *NIX os like systems can use this module.
Dependencies
- puppetlabs-vcsrepo (>= 1.4.0)
- puppet-archive (>= 2.2.0)
- puppetlabs-stdlib (>= 4.23.0)