plnxtools/manifests/init.pp

82 lines
1.2 KiB
Puppet
Raw Normal View History

#
# init.pp
#
2020-07-23 21:45:09 +02:00
class plnxtools(
$opt_dir = $plnxtools::params::opt_dir,
# a list of packages to install jdks
$jdks = $plnxtools::params::jdks,
# default JAVA_HOME
$java_home = $plnxtools::params::java_home,
2020-07-23 21:45:09 +02:00
)
inherits plnxtools::params{
file {"opt_dir":
2020-07-23 21:45:09 +02:00
path => $opt_dir,
ensure => directory
2020-07-25 11:09:12 +02:00
}->
file {"opt_dir_plnx":
path => "$opt_dir/plnxtools",
ensure => directory
}
2020-07-16 19:02:02 +02:00
#
# For most tools FreeBSD needs to bash installed
# accassible by /bin/bash
#
2020-07-16 19:02:02 +02:00
if $::osfamily == 'FreeBSD' {
package {"bash":
ensure => installed
} ->
file {"/bin/bash":
ensure => link,
target => "/usr/local/bin/bash"
}
}
package { $jdks:
2020-07-23 18:40:15 +02:00
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}",
}
}
2020-07-23 18:40:15 +02:00