>>>
>>> I would highly recommend you just package your custom python and install
>>> it using a package management system, rather than doing what you're
>>> doing.
In this case you really ought to consider packaging, but there's
always *something* that doesn't work that way for whatever reason
(badly-wrapped vendor software is a favorite here). IMHO a tarball
installer is a necessary evil in certain situations. It'll probably
take a bit of tweaking to get it working in your environment , but
this works well for me.
# Define: packages::tar::install
#
# This define installs tar-based packages, including making sure they're
# only installed once and performing cleanup after the installation.
#
# Sample Usage:
# packages::tar::install { 'vmware-solaris-tools':
# package => 'vmware-solaris-tools-381511.tar.gz', # name of tarball
# repo => '
http://hostname/path', # ftp or http path minus filename
# dir => 'vmware-tools-distrib', # top-level directory in the tarball
# installer => '
vmware-install.pl', # name of install script
# options => '-d', # options to pass to install script
# tmpdir => '/opt/tmp', # dir to extract tarball into
# }
define packages::tar::install($repo,$package,$dir,$installer,$options,$tmpdir='/var/tmp',
$timeout='600',$dotdir='/opt/puppet/libexec'){
exec { "wget -O $tmpdir/$package $repo/$package":
unless => "/usr/bin/test -f ${dotdir}/.${package}",
path => ["/opt/csw/bin","/usr/bin"],
alias => "wget_${package}",
require => File["$tmpdir"],
}
exec { "gunzip -c $tmpdir/$package | tar xf - ":
unless => "/usr/bin/test -f ${dotdir}/.${package}",
path => ["/bin","/usr/bin","/usr/sbin"],
alias => "untar_${package}",
cwd => "$tmpdir",
require => Exec["wget_${package}"],
}
exec { "$tmpdir/$dir/$installer $options":
unless => "/usr/bin/test -f ${dotdir}/.${package}",
cwd => "$tmpdir/$dir",
alias => "install_${package}",
timeout => "$timeout",
require => Exec["untar_${package}"],
}
exec { "touch ${dotdir}/.${package}":
path => ["/bin","/usr/bin"],
unless => "/usr/bin/test -f ${dotdir}/.${package}",
alias => "${package}_dotfile",
require => Exec["install_${package}"],
}
exec { "rm -rf $tmpdir/$dir":
path => ["/bin","/usr/bin"],
onlyif => "/usr/bin/test -d $tmpdir/$dir",
cwd => "$tmpdir",
alias => "rm_${dir}",
require => Exec["install_${package}"],
}
exec { "rm -f $tmpdir/$package":
path => ["/bin","/usr/bin"],
onlyif => "/usr/bin/test -f $tmpdir/$package",
cwd => "$tmpdir",
alias => "rm_${package}",
require => Exec["install_${package}"],
}
}