plnxtools/manifests/init.pp

63 lines
858 B
Puppet

#
# init.pp
#
class plnxtools{
file {"opt_dir":
path => "/opt",
ensure => directory
}
if $::osfamily == 'FreeBSD' {
package {"bash":
ensure => installed
} ->
file {"/bin/bash":
ensure => link,
target => "/usr/local/bin/bash"
}
}
package { 'openjdk11':
ensure => installed
}
}
define plnxtools::install
(
$distfile,
$sourcedir,
$dirname,
$sourcefile="${sourcedir}/${distfile}",
$opt_dir = "/opt",
$checksum = undef,
$checksum_type = undef,
)
{
archive { "/tmp/$distfile":
ensure => present,
source => $sourcefile,
extract_path => $opt_dir,
extract => true,
cleanup => true,
checksum => $checksum,
checksum_type => $checksum_type,
creates => "${opt_dir}/${dirname}",
# require => [
# File['opt_dir']
# ]
} ->
file { "/opt/$title":
ensure => link,
target => "/opt/${dirname}",
}
}