# instsall lidarr class lidarr::install ( $packages = $lidarr::packages, $user = $lidarr::user, $group = $lidarr::group, $manage_group = $lidarr::manage_group, $base_path = $lidarr::base_path, $install_path = $lidarr::install_path, $config_folder = $lidarr::config_folder, $app_folder = $lidarr::app_folder, $archive_name = $lidarr::archive_name, $archive_url = $lidarr::archive_url, $executable = $lidarr::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_lidarr_files'], } exec { 'move_lidarr_files': command => "/usr/bin/mv ${install_path}/Lidarr/* ${install_path}", creates => "${install_path}/${executable}", } }