From fa5308e3f503d560145340ce75ec2340eb01500c Mon Sep 17 00:00:00 2001 From: Stefan - Zipkid - Goethals Date: Wed, 6 Dec 2023 11:10:25 +0100 Subject: [PATCH] Add validation for nexus::version when using package_type => src --- manifests/package.pp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/manifests/package.pp b/manifests/package.pp index 00e086b..544da3e 100644 --- a/manifests/package.pp +++ b/manifests/package.pp @@ -8,6 +8,9 @@ case $nexus::package_type { 'src': { + if !$nexus::version { + fail('nexus::version must be set when using package_type => src') + } $nexus_archive = "nexus-${nexus::version}-unix.tar.gz" $download_url = "${nexus::download_site}/${nexus_archive}" $dl_file = "${nexus::download_folder}/${nexus_archive}" @@ -64,11 +67,11 @@ "${nexus::work_dir}/tmp", ] - file{ $directories: + file { $directories: ensure => directory, owner => $nexus::user, group => $nexus::group, - require => Archive[ $dl_file ] + require => Archive[$dl_file], } } }