Puppet Class: python::global

Defined in:
manifests/global.pp

Overview

Parameters:

  • version (Any) (defaults to: '2.7.10')


8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'manifests/global.pp', line 8

class python::global(
  $version = '2.7.10',
) {
  require python

  if is_array($version) {
    $version_list = $version
  } else {
    $version_list = split($version, '[, ]+')
  }
  $version_list_without_system = delete($version_list, 'system')
  if count($version_list_without_system) > 0 {
    ensure_resource('python::version', $version_list_without_system)
    $require = Python::Version[$version_list_without_system]
  } else {
    $require = undef
  }

  file { "${python::pyenv::prefix}/version":
    ensure  => present,
    owner   => $python::user,
    mode    => '0644',
    content => join($version_list, "\n"),
    require => $require,
  }
}