Puppet Class: pythonenv

Defined in:
manifests/init.pp

Overview

Configure python environment for system

Parameters:

  • versions (Any) (defaults to: ['2.7.10', '3.5.0'])
  • default (Any) (defaults to: ['2.7.10', '3.5.0'])
  • modules (Any) (defaults to: [])


2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'manifests/init.pp', line 2

class pythonenv(
  $versions = ['2.7.10', '3.5.0'],
  $default = ['2.7.10', '3.5.0'],
  $modules = []
) {
  include python

  python::version { $versions:
    require => Class['openssl']
  } ->
  class { 'python::global':
    version => $default
  }

  $modules.each |$module| {
    python::package { $module:
      python => $versions
    }
  }

  $system_pips = [
    '/usr/local/bin/pip',
    '/usr/local/bin/pip2',
    '/usr/local/bin/pip2.7'
  ]
  file { $system_pips:
    ensure => absent
  }
}