Defined Type: python::local

Defined in:
manifests/local.pp

Overview

Parameters:

  • version (Any) (defaults to: undef)
  • ensure (Any) (defaults to: present)


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
# File 'manifests/local.pp', line 8

define python::local(
  $version = undef,
  $ensure  = present,
) {
  include python

  case $version {
    'system', undef: { $require = undef }

    default: {
      ensure_resource('python::version', $version)
      $require = Python::Version[$version]
    }

  }

  file { "${name}/.pyenv-version":
    ensure => absent
  } -> file { "${name}/.python-version":
    ensure  => $ensure,
    content => "${version}\n",
    replace => true,
    require => $require
  }
}