From e3fb2348f29f9c21bcfd81a3682b45c603710850 Mon Sep 17 00:00:00 2001 From: Alessandro Franceschi Date: Tue, 24 Sep 2024 13:25:26 +0200 Subject: [PATCH] more lints --- .puppet-lint.rc | 3 ++- manifests/netinstall.pp | 4 ++-- manifests/project/git.pp | 4 ++-- manifests/project/hg.pp | 4 ++-- manifests/project/mysql.pp | 2 ++ manifests/project/svn.pp | 4 ++-- manifests/project/tar.pp | 2 +- manifests/project/y4maven.pp | 6 +++--- manifests/runscript.pp | 2 +- 9 files changed, 17 insertions(+), 14 deletions(-) diff --git a/.puppet-lint.rc b/.puppet-lint.rc index 8d66c08..15a070c 100644 --- a/.puppet-lint.rc +++ b/.puppet-lint.rc @@ -1,2 +1,3 @@ --relative ---ignore-lint-parameter_documentation \ No newline at end of file +--no-parameter_documentation +--no-params_empty_string \ No newline at end of file diff --git a/manifests/netinstall.pp b/manifests/netinstall.pp index 9df9e6b..9803c6a 100644 --- a/manifests/netinstall.pp +++ b/manifests/netinstall.pp @@ -67,7 +67,7 @@ String $retrieve_args = '', String $owner = 'root', String $group = 'root', - $timeout = '3600', + Variant[String,Integer] $timeout = '3600', String $work_dir = '/var/tmp', String $path = '/bin:/sbin:/usr/bin:/usr/sbin', String $extract_command = '', @@ -133,7 +133,7 @@ } exec { "Extract ${source_filename} from ${work_dir} - ${title}": - command => "mkdir -p ${destination_dir} && cd ${destination_dir} && ${real_extract_command} ${work_dir}/${source_filename} ${extract_command_second_arg}", + command => "mkdir -p ${destination_dir} && cd ${destination_dir} && ${real_extract_command} ${work_dir}/${source_filename} ${extract_command_second_arg}", # lint:ignore:140chars unless => "ls ${destination_dir}/${real_extracted_dir}", creates => "${destination_dir}/${real_extracted_dir}", timeout => $timeout, diff --git a/manifests/project/git.pp b/manifests/project/git.pp index 17bb66b..74635d1 100755 --- a/manifests/project/git.pp +++ b/manifests/project/git.pp @@ -252,7 +252,7 @@ puppi::deploy { "${name}-Deploy_Files": priority => '40' , command => 'git.sh' , - arguments => "-a deploy -s ${source} -d ${deploy_root} -u ${user} -gs ${git_subdir} -t ${tag} -b ${branch} -c ${commit} -v ${bool_verbose} -k ${bool_keep_gitdata}" , + arguments => "-a deploy -s ${source} -d ${deploy_root} -u ${user} -gs ${git_subdir} -t ${tag} -b ${branch} -c ${commit} -v ${bool_verbose} -k ${bool_keep_gitdata}" , # lint:ignore:140chars user => 'root' , project => $name , enable => $enable , @@ -352,7 +352,7 @@ puppi::rollback { "${name}-Rollback_Files": priority => '40' , command => 'git.sh' , - arguments => "-a rollback -s ${source} -d ${deploy_root} -gs ${git_subdir} -t ${tag} -b ${branch} -c ${commit} -v ${bool_verbose} -k ${bool_keep_gitdata}" , + arguments => "-a rollback -s ${source} -d ${deploy_root} -gs ${git_subdir} -t ${tag} -b ${branch} -c ${commit} -v ${bool_verbose} -k ${bool_keep_gitdata}" , # lint:ignore:140chars user => $user , project => $name , enable => $enable , diff --git a/manifests/project/hg.pp b/manifests/project/hg.pp index 7eac5af..4b7df6c 100644 --- a/manifests/project/hg.pp +++ b/manifests/project/hg.pp @@ -246,7 +246,7 @@ puppi::deploy { "${name}-Deploy_Files": priority => '40' , command => 'hg.sh' , - arguments => "-a deploy -s ${source} -d ${deploy_root} -u ${user} -t ${tag} -b ${branch} -c ${commit} -v ${bool_verbose} -k ${bool_keep_hgdata}" , + arguments => "-a deploy -s ${source} -d ${deploy_root} -u ${user} -t ${tag} -b ${branch} -c ${commit} -v ${bool_verbose} -k ${bool_keep_hgdata}" , # lint:ignore:140chars user => 'root' , project => $name , enable => $enable , @@ -346,7 +346,7 @@ puppi::rollback { "${name}-Rollback_Files": priority => '40' , command => 'hg.sh' , - arguments => "-a rollback -s ${source} -d ${deploy_root} -t ${tag} -b ${branch} -c ${commit} -v ${bool_verbose} -k ${bool_keep_hgdata}" , + arguments => "-a rollback -s ${source} -d ${deploy_root} -t ${tag} -b ${branch} -c ${commit} -v ${bool_verbose} -k ${bool_keep_hgdata}" , # lint:ignore:140chars user => $user , project => $name , enable => $enable , diff --git a/manifests/project/mysql.pp b/manifests/project/mysql.pp index 9ad8853..138ad7d 100644 --- a/manifests/project/mysql.pp +++ b/manifests/project/mysql.pp @@ -102,6 +102,8 @@ define puppi::project::mysql ( String $source, String $mysql_database, + String $deploy_root = '', + String $user = 'root', String $mysql_user = 'root', String $mysql_host = 'localhost', String $mysql_password = '', diff --git a/manifests/project/svn.pp b/manifests/project/svn.pp index e275cd7..059f54c 100644 --- a/manifests/project/svn.pp +++ b/manifests/project/svn.pp @@ -272,7 +272,7 @@ puppi::deploy { "${name}-Deploy_Files": priority => '40' , command => 'svn.sh' , - arguments => "-a deploy -s ${source} -d ${deploy_root} -u ${user} -gs ${svn_subdir} -su ${svn_user} -sp ${svn_password} -t ${tag} -b ${branch} -c ${commit} -v ${bool_verbose} -k ${bool_keep_svndata} -e ${bool_svn_export}" , + arguments => "-a deploy -s ${source} -d ${deploy_root} -u ${user} -gs ${svn_subdir} -su ${svn_user} -sp ${svn_password} -t ${tag} -b ${branch} -c ${commit} -v ${bool_verbose} -k ${bool_keep_svndata} -e ${bool_svn_export}" , # lint:ignore:140chars user => 'root' , project => $name , enable => $enable , @@ -373,7 +373,7 @@ puppi::rollback { "${name}-Rollback_Files": priority => '40' , command => 'svn.sh' , - arguments => "-a rollback -s ${source} -d ${deploy_root} -gs ${svn_subdir} -t ${tag} -b ${branch} -c ${commit} -v ${bool_verbose} -k ${bool_keep_svndata}" , + arguments => "-a rollback -s ${source} -d ${deploy_root} -gs ${svn_subdir} -t ${tag} -b ${branch} -c ${commit} -v ${bool_verbose} -k ${bool_keep_svndata}" , # lint:ignore:140chars user => $user , project => $name , enable => $enable , diff --git a/manifests/project/tar.pp b/manifests/project/tar.pp index 1144cc5..10b83cb 100644 --- a/manifests/project/tar.pp +++ b/manifests/project/tar.pp @@ -170,7 +170,7 @@ if ($verify_ssl) { $ssl_arg = '' - }else { + } else { $ssl_arg = '-k' } diff --git a/manifests/project/y4maven.pp b/manifests/project/y4maven.pp index 0117eb5..8c92fa9 100644 --- a/manifests/project/y4maven.pp +++ b/manifests/project/y4maven.pp @@ -293,8 +293,8 @@ # First: hybrisServer-Platform $platform_metadata_arguments = $http_password ? { - '' => "-s ${source}/hybrisServer-Platform/maven-metadata.xml -t maven-metadata -a ${real_always_deploy}" , - default => "-s ${source}/hybrisServer-Platform/maven-metadata.xml -t maven-metadata -a ${real_always_deploy} -u ${http_user} -p ${http_password}" + '' => "-s ${source}/hybrisServer-Platform/maven-metadata.xml -t maven-metadata -a ${real_always_deploy}" , + default => "-s ${source}/hybrisServer-Platform/maven-metadata.xml -t maven-metadata -a ${real_always_deploy} -u ${http_user} -p ${http_password}", # lint:ignore:140chars } puppi::deploy { "${name}-Get_Maven_Metadata_hybrisServer-Platform_File": @@ -335,7 +335,7 @@ # Second: hybrisServer-AllExtensions $extensions_metadata_arguments = $http_password ? { '' => "-s ${source}/hybrisServer-AllExtensions/maven-metadata.xml -t maven-metadata -a ${real_always_deploy}", - default => "-s ${source}/hybrisServer-AllExtensions/maven-metadata.xml -t maven-metadata -a ${real_always_deploy} -u ${http_user} -p ${http_password}", + default => "-s ${source}/hybrisServer-AllExtensions/maven-metadata.xml -t maven-metadata -a ${real_always_deploy} -u ${http_user} -p ${http_password}", # lint:ignore:140chars } puppi::deploy { "${name}-Get_Maven_Metadata_hybrisServer-AllExtensions_File": diff --git a/manifests/runscript.pp b/manifests/runscript.pp index ee20ad8..7e2e0f3 100644 --- a/manifests/runscript.pp +++ b/manifests/runscript.pp @@ -107,7 +107,7 @@ Optional[String] $creates = undef, Optional[String] $onlyif = undef, Optional[String] $unless = undef, - String $asedir = '/usr/local/sbin', + String $basedir = '/usr/local/sbin', String $cron = '', String $cron_user = 'root', String $owner = 'root',