Defined Type: python::alias
- Defined in:
- manifests/alias.pp
Overview
Aliases a python version to another
Usage:
python::alias { '2.7': to => '2.7.8' }
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 31 32 |
# File 'manifests/alias.pp', line 6
define python::alias (
$ensure = 'installed',
$to = undef,
$version = $title,
) {
require python
if $to == undef {
fail('to cannot be undefined')
}
if $ensure != 'absent' {
ensure_resource('python::version', $to)
}
$file_ensure = $ensure ? {
/^(installed|present)$/ => 'symlink',
default => $ensure,
}
file { "/opt/python/${version}":
ensure => $file_ensure,
force => true,
target => "/opt/python/${to}",
require => Python::Version[$to],
}
}
|