37 lines
1.0 KiB
ObjectPascal
37 lines
1.0 KiB
ObjectPascal
|
|
# modules/frankenphp/manifests/install.pp
|
||
|
|
|
||
|
|
class frankenphp::install (
|
||
|
|
$version = $frankenphp::params::version,
|
||
|
|
$package_name = $frankenphp::params::package_name,
|
||
|
|
$download_url = $frankenphp::params::download_url,
|
||
|
|
$local_deb_path = $frankenphp::params::local_deb_path,
|
||
|
|
) inherits frankenphp::params {
|
||
|
|
|
||
|
|
if ! defined(Package['wget']) {
|
||
|
|
package { 'wget':
|
||
|
|
ensure => installed,
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
exec { "download-frankenphp-${version}":
|
||
|
|
command => "/usr/bin/wget -q '${download_url}' -O '${local_deb_path}'",
|
||
|
|
creates => $local_deb_path,
|
||
|
|
path => ['/usr/bin', '/bin'],
|
||
|
|
require => Package['wget'],
|
||
|
|
}
|
||
|
|
|
||
|
|
package { $package_name:
|
||
|
|
ensure => 'installed',
|
||
|
|
provider => 'dpkg',
|
||
|
|
source => $local_deb_path,
|
||
|
|
require => Exec["download-frankenphp-${version}"],
|
||
|
|
notify => Exec["cleanup-frankenphp-deb-${version}"],
|
||
|
|
}
|
||
|
|
|
||
|
|
exec { "cleanup-frankenphp-deb-${version}":
|
||
|
|
command => "/bin/rm -f '${local_deb_path}'",
|
||
|
|
path => ['/bin'],
|
||
|
|
refreshonly => true,
|
||
|
|
}
|
||
|
|
}
|