Added source parameter to python::setup::install
This commit is contained in:
parent
ebad927590
commit
24aea7045b
1 changed files with 27 additions and 2 deletions
|
@ -30,12 +30,37 @@ class python {
|
||||||
# Source directory.
|
# Source directory.
|
||||||
# $python:
|
# $python:
|
||||||
# Python executable name. Defaults to python.
|
# Python executable name. Defaults to python.
|
||||||
|
# $source:
|
||||||
|
# Source path to package archive.
|
||||||
#
|
#
|
||||||
# === Sample usage
|
# === Sample usage
|
||||||
#
|
#
|
||||||
# python::setup::install { "/usr/local/src/moin-1.8.8": }
|
# python::setup::install { "/usr/local/src/moin-1.8.8":
|
||||||
|
# source => "puppet:///files/packages/moin-1.8.8.tar.gz",
|
||||||
|
# }
|
||||||
#
|
#
|
||||||
define python::setup::install($python="python") {
|
define python::setup::install($python="python", source="") {
|
||||||
|
|
||||||
|
if $source {
|
||||||
|
$filename = basename($source)
|
||||||
|
file { "/usr/local/src/${filename}":
|
||||||
|
ensure => present,
|
||||||
|
mode => "0644",
|
||||||
|
owner => "root",
|
||||||
|
group => $operatingsystem ? {
|
||||||
|
"openbsd" => "wheel",
|
||||||
|
default => "root",
|
||||||
|
},
|
||||||
|
source => $source,
|
||||||
|
}
|
||||||
|
util::extract::tar { $name:
|
||||||
|
ensure => latest,
|
||||||
|
strip => 1,
|
||||||
|
source => "/usr/local/src/${filename}",
|
||||||
|
require => File["/usr/local/src/${filename}"],
|
||||||
|
before => Exec["python-setup-install-${name}"],
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
exec { "python-setup-install-${name}":
|
exec { "python-setup-install-${name}":
|
||||||
path => "/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin",
|
path => "/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin",
|
||||||
|
|
Loading…
Add table
Reference in a new issue