- change hieradata/role/apps/media/* to use correct namespaces - add manage_group boolean to all *arr stack modules
62 lines
1.6 KiB
Puppet
62 lines
1.6 KiB
Puppet
# instsall prowlarr
|
|
class prowlarr::install (
|
|
$packages = $prowlarr::packages,
|
|
$user = $prowlarr::user,
|
|
$group = $prowlarr::group,
|
|
$manage_group = $prowlarr::manage_group,
|
|
$base_path = $prowlarr::base_path,
|
|
$install_path = $prowlarr::install_path,
|
|
$config_folder = $prowlarr::config_folder,
|
|
$app_folder = $prowlarr::app_folder,
|
|
$archive_name = $prowlarr::archive_name,
|
|
$archive_url = $prowlarr::archive_url,
|
|
$executable = $prowlarr::executable,
|
|
) {
|
|
|
|
$_packages = $packages ? {
|
|
Array => true,
|
|
default => false,
|
|
}
|
|
|
|
if $_packages {
|
|
ensure_packages($packages, {ensure => 'installed'})
|
|
}
|
|
|
|
if $manage_group {
|
|
group { $group:
|
|
ensure => present,
|
|
}
|
|
}
|
|
|
|
user { $user:
|
|
ensure => present,
|
|
shell => '/sbin/nologin',
|
|
groups => $group,
|
|
managehome => true,
|
|
}
|
|
|
|
file { [ $base_path, $install_path, $config_folder, $app_folder ]:
|
|
ensure => directory,
|
|
owner => $user,
|
|
group => $group,
|
|
}
|
|
|
|
archive { $archive_name:
|
|
path => "/tmp/${archive_name}",
|
|
source => "${archive_url}${archive_name}",
|
|
extract => true,
|
|
extract_path => $install_path,
|
|
creates => "${install_path}/${executable}",
|
|
cleanup => true,
|
|
require => File[$install_path],
|
|
user => $user,
|
|
group => $group,
|
|
notify => Exec['move_prowlarr_files'],
|
|
}
|
|
|
|
exec { 'move_prowlarr_files':
|
|
command => "/usr/bin/mv ${install_path}/Prowlarr/* ${install_path}",
|
|
creates => "${install_path}/${executable}",
|
|
}
|
|
}
|