diff --git a/.puppet-lint.rc b/.puppet-lint.rc index c5be7aab..cc96ece0 100644 --- a/.puppet-lint.rc +++ b/.puppet-lint.rc @@ -1,5 +1 @@ --relative ---no-parameter_types-check ---no-relative_classname_inclusion-check ---no-legacy_facts-check ---no-anchor_resource-check diff --git a/.sync.yml b/.sync.yml index 3b69f7ad..d03bffc6 100644 --- a/.sync.yml +++ b/.sync.yml @@ -28,9 +28,3 @@ spec/spec_helper.rb: unmanaged: false .travis.yml: delete: true -Rakefile: - extra_disabled_lint_checks: - - parameter_types - - relative_classname_inclusion - - legacy_facts - - anchor_resource diff --git a/Rakefile b/Rakefile index 21c1ccca..2906c15b 100644 --- a/Rakefile +++ b/Rakefile @@ -42,11 +42,6 @@ def changelog_future_release end PuppetLint.configuration.send('disable_relative') -PuppetLint.configuration.send('disable_parameter_types') -PuppetLint.configuration.send('disable_relative_classname_inclusion') -PuppetLint.configuration.send('disable_legacy_facts') -PuppetLint.configuration.send('disable_anchor_resource') - if Bundler.rubygems.find_name('github_changelog_generator').any? GitHubChangelogGenerator::RakeTask.new :changelog do |config| diff --git a/manifests/adopt.pp b/manifests/adopt.pp index fde321b8..957a7f03 100644 --- a/manifests/adopt.pp +++ b/manifests/adopt.pp @@ -13,7 +13,8 @@ # Major version which should be installed, e.g. '8u101' or '9.0.4'. Must be used together with version_minor. # # @param version_minor -# Minor version which should be installed, e.g. 'b12' (for version = '8') or '11' (for version != '8'). Must be used together with version_major. +# Minor version which should be installed, e.g. 'b12' (for version = '8') or '11' (for version != '8'). +# Must be used together with version_major. # # @param java # Type of Java Standard Edition to install, jdk or jre. @@ -32,7 +33,7 @@ # /usr/lib/jvm for Debian and /usr/java for RedHat. # # @param manage_basedir -# Whether to manage the basedir directory. Defaults to false. +# Whether to manage the basedir directory. # Note: /usr/lib/jvm is managed for Debian by default, separate from this parameter. # # @param package_type @@ -47,22 +48,22 @@ # The name for the optional symlink in the installation directory. # define java::adopt ( - $ensure = 'present', - $version = '8', - $version_major = undef, - $version_minor = undef, - $java = 'jdk', - $proxy_server = undef, - $proxy_type = undef, - $url = undef, - $basedir = undef, - $manage_basedir = true, - $package_type = undef, - $manage_symlink = false, - $symlink_name = undef, + Enum['present'] $ensure = 'present', + String[1] $version = '8', + Optional[String] $version_major = undef, + Optional[String] $version_minor = undef, + String[1] $java = 'jdk', + Optional[String] $proxy_server = undef, + Optional[String] $proxy_type = undef, + Optional[String] $url = undef, + Optional[String] $basedir = undef, + Boolean $manage_basedir = true, + Optional[String] $package_type = undef, + Boolean $manage_symlink = false, + Optional[String] $symlink_name = undef, ) { # archive module is used to download the java package - include ::archive + include archive # validate java Standard Edition to download if $java !~ /(jre|jdk)/ { @@ -188,7 +189,6 @@ # set java architecture nomenclature $os_architecture = $facts['os']['architecture'] ? { - undef => $facts['architecture'], default => $facts['os']['architecture'] } diff --git a/manifests/adoptium.pp b/manifests/adoptium.pp index 6f87e602..c39d36b5 100644 --- a/manifests/adoptium.pp +++ b/manifests/adoptium.pp @@ -42,21 +42,21 @@ # The name for the optional symlink in the installation directory. # define java::adoptium ( - $ensure = 'present', - $version_major = undef, - $version_minor = undef, - $version_patch = undef, - $version_build = undef, - $proxy_server = undef, - $proxy_type = undef, - $url = undef, - $basedir = undef, - $manage_basedir = true, - $manage_symlink = false, - $symlink_name = undef, + Enum['present'] $ensure = 'present', + Optional[String] $version_major = undef, + Optional[String] $version_minor = undef, + Optional[String] $version_patch = undef, + Optional[String] $version_build = undef, + Optional[String] $proxy_server = undef, + Optional[Enum['none', 'http', 'https', 'ftp']] $proxy_type = undef, + Optional[String] $url = undef, + Optional[String] $basedir = undef, + Boolean $manage_basedir = true, + Boolean $manage_symlink = false, + Optional[String] $symlink_name = undef, ) { # archive module is used to download the java package - include ::archive + include archive $install_path = "jdk-${version_major}.${version_minor}.${version_patch}+${version_build}" @@ -93,7 +93,6 @@ # set java architecture nomenclature $os_architecture = $facts['os']['architecture'] ? { - undef => $facts['architecture'], default => $facts['os']['architecture'] } diff --git a/manifests/download.pp b/manifests/download.pp index 8c31fbef..e8593820 100644 --- a/manifests/download.pp +++ b/manifests/download.pp @@ -54,21 +54,21 @@ # The name for the optional symlink in the installation directory. # define java::download ( - $ensure = 'present', - $version = '8', - $version_major = undef, - $version_minor = undef, - $java_se = 'jdk', - $proxy_server = undef, - $proxy_type = undef, - $url = undef, - $jce = false, - $jce_url = undef, - $basedir = undef, - $manage_basedir = false, - $package_type = undef, - $manage_symlink = false, - $symlink_name = undef, + Enum['present'] $ensure = 'present', + String[1] $version = '8', + Optional[String] $version_major = undef, + Optional[String] $version_minor = undef, + String[1] $java_se = 'jdk', + Optional[String] $proxy_server = undef, + Optional[Enum['none', 'http', 'https', 'ftp']] $proxy_type = undef, + Optional[String] $url = undef, + Boolean $jce = false, + Optional[String] $jce_url = undef, + Optional[String] $basedir = undef, + Boolean $manage_basedir = false, + Optional[String] $package_type = undef, + Boolean $manage_symlink = false, + Optional[String] $symlink_name = undef, ) { # archive module is used to download the java package include archive diff --git a/manifests/init.pp b/manifests/init.pp index 43811e7c..c70ee162 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -36,15 +36,15 @@ # environment variable. # class java ( - String $distribution = 'jdk', - Pattern[/present|installed|latest|^[.+_0-9a-zA-Z:~-]+$/] $version = 'present', - Optional[String] $package = undef, - Optional[Array] $package_options = undef, - Optional[String] $java_alternative = undef, - Optional[String] $java_alternative_path = undef, - Optional[String] $java_home = undef + String $distribution = 'jdk', + Pattern[/present|installed|latest|^[.+_0-9a-zA-Z:~-]+$/] $version = 'present', + Optional[String] $package = undef, + Optional[Array] $package_options = undef, + Optional[String] $java_alternative = undef, + Optional[String] $java_alternative_path = undef, + Optional[String] $java_home = undef ) { - include ::java::params + contain java::params $default_package_name = has_key($java::params::java, $distribution) ? { false => undef, @@ -118,12 +118,10 @@ } } - anchor { 'java::begin:': } - -> package { 'java': + package { 'java': ensure => $version, install_options => $package_options, name => $use_java_package_name, } -> class { 'java::config': } - -> anchor { 'java::end': } } diff --git a/manifests/sap.pp b/manifests/sap.pp index e8e893d2..05618be4 100644 --- a/manifests/sap.pp +++ b/manifests/sap.pp @@ -26,7 +26,7 @@ # /usr/lib/jvm for Debian and /usr/java for RedHat. # # @param manage_basedir -# Whether to manage the basedir directory. Defaults to false. +# Whether to manage the basedir directory. # Note: /usr/lib/jvm is managed for Debian by default, separate from this parameter. # # @param manage_symlink @@ -36,19 +36,19 @@ # The name for the optional symlink in the installation directory. # define java::sap ( - $ensure = 'present', - $version = '8', - $version_full = undef, - $java = 'jdk', - $proxy_server = undef, - $proxy_type = undef, - $basedir = undef, - $manage_basedir = true, - $manage_symlink = false, - $symlink_name = undef, + Enum['present'] $ensure = 'present', + String[1] $version = '8', + Optional[String] $version_full = undef, + String[1] $java = 'jdk', + Optional[String] $proxy_server = undef, + Optional[Enum['none', 'http', 'https', 'ftp']] $proxy_type = undef, + Optional[String] $basedir = undef, + Boolean $manage_basedir = true, + Boolean $manage_symlink = false, + Optional[String] $symlink_name = undef, ) { # archive module is used to download the java package - include ::archive + include archive # validate java edition to download if $java !~ /(jre|jdk)/ { @@ -128,7 +128,6 @@ } $_os_architecture = $facts['os']['architecture'] ? { - undef => $facts['architecture'], default => $facts['os']['architecture'] }