Skip to content
This repository was archived by the owner on May 15, 2019. It is now read-only.

Commit 57eee31

Browse files
committed
Merge pull request voxpupuli#172 from sethcleveland/master
Allow hiera configuration of python resources
2 parents 69127e6 + 255c939 commit 57eee31

2 files changed

Lines changed: 27 additions & 0 deletions

File tree

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,25 @@ python::dotfile { '/var/lib/jenkins/.pip/pip.conf':
257257
}
258258
```
259259

260+
### hiera configuration
261+
262+
This module supports configuration through hiera. The following example
263+
creates two python3 virtualenvs. The configuration also pip installs a
264+
package into each environment.
265+
266+
```yaml
267+
python::python_pyvenvs:
268+
"/opt/env1":
269+
version: "system"
270+
"/opt/env2":
271+
version: "system"
272+
python::python_pips:
273+
"nose":
274+
virtualenv: "/opt/env1"
275+
"coverage":
276+
virtualenv: "/opt/env2"
277+
```
278+
260279
## Authors
261280
262281
[Sergey Stankevich](https://github.com/stankevich)

manifests/init.pp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@
6060
$manage_gunicorn = $python::params::manage_gunicorn,
6161
$provider = $python::params::provider,
6262
$valid_versions = $python::params::valid_versions,
63+
$python_pips = { },
64+
$python_virtualenvs = { },
65+
$python_pyvenvs = { },
6366
) inherits python::params{
6467

6568
# validate inputs
@@ -92,4 +95,9 @@
9295
class { 'python::config': } ->
9396
anchor { 'python::end': }
9497

98+
# Allow hiera configuration of python resources
99+
create_resources('python::pip', $python_pips)
100+
create_resources('python::pyvenv', $python_pyvenvs)
101+
create_resources('python::virtualenv', $python_virtualenvs)
102+
95103
}

0 commit comments

Comments
 (0)