Skip to content

Commit d6b346c

Browse files
authored
Merge pull request #543 from puppetlabs/CONT-356-Syntax_update
(CONT-356) Syntax update
2 parents 985a802 + 6ff04d5 commit d6b346c

File tree

8 files changed

+66
-85
lines changed

8 files changed

+66
-85
lines changed

.puppet-lint.rc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1 @@
11
--relative
2-
--no-parameter_types-check
3-
--no-relative_classname_inclusion-check
4-
--no-legacy_facts-check
5-
--no-anchor_resource-check

.sync.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,3 @@ spec/spec_helper.rb:
2929
unmanaged: false
3030
.travis.yml:
3131
delete: true
32-
Rakefile:
33-
extra_disabled_lint_checks:
34-
- parameter_types
35-
- relative_classname_inclusion
36-
- legacy_facts
37-
- anchor_resource

Rakefile

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,6 @@ def changelog_future_release
4242
end
4343

4444
PuppetLint.configuration.send('disable_relative')
45-
PuppetLint.configuration.send('disable_parameter_types')
46-
PuppetLint.configuration.send('disable_relative_classname_inclusion')
47-
PuppetLint.configuration.send('disable_legacy_facts')
48-
PuppetLint.configuration.send('disable_anchor_resource')
49-
5045

5146
if Bundler.rubygems.find_name('github_changelog_generator').any?
5247
GitHubChangelogGenerator::RakeTask.new :changelog do |config|

manifests/adopt.pp

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
# Major version which should be installed, e.g. '8u101' or '9.0.4'. Must be used together with version_minor.
1414
#
1515
# @param version_minor
16-
# Minor version which should be installed, e.g. 'b12' (for version = '8') or '11' (for version != '8'). Must be used together with version_major.
16+
# Minor version which should be installed, e.g. 'b12' (for version = '8') or '11' (for version != '8').
17+
# Must be used together with version_major.
1718
#
1819
# @param java
1920
# Type of Java Standard Edition to install, jdk or jre.
@@ -32,7 +33,7 @@
3233
# /usr/lib/jvm for Debian and /usr/java for RedHat.
3334
#
3435
# @param manage_basedir
35-
# Whether to manage the basedir directory. Defaults to false.
36+
# Whether to manage the basedir directory.
3637
# Note: /usr/lib/jvm is managed for Debian by default, separate from this parameter.
3738
#
3839
# @param package_type
@@ -47,22 +48,22 @@
4748
# The name for the optional symlink in the installation directory.
4849
#
4950
define java::adopt (
50-
$ensure = 'present',
51-
$version = '8',
52-
$version_major = undef,
53-
$version_minor = undef,
54-
$java = 'jdk',
55-
$proxy_server = undef,
56-
$proxy_type = undef,
57-
$url = undef,
58-
$basedir = undef,
59-
$manage_basedir = true,
60-
$package_type = undef,
61-
$manage_symlink = false,
62-
$symlink_name = undef,
51+
Enum['present'] $ensure = 'present',
52+
String[1] $version = '8',
53+
Optional[String] $version_major = undef,
54+
Optional[String] $version_minor = undef,
55+
String[1] $java = 'jdk',
56+
Optional[String] $proxy_server = undef,
57+
Optional[String] $proxy_type = undef,
58+
Optional[String] $url = undef,
59+
Optional[String] $basedir = undef,
60+
Boolean $manage_basedir = true,
61+
Optional[String] $package_type = undef,
62+
Boolean $manage_symlink = false,
63+
Optional[String] $symlink_name = undef,
6364
) {
6465
# archive module is used to download the java package
65-
include ::archive
66+
include archive
6667

6768
# validate java Standard Edition to download
6869
if $java !~ /(jre|jdk)/ {
@@ -188,7 +189,6 @@
188189

189190
# set java architecture nomenclature
190191
$os_architecture = $facts['os']['architecture'] ? {
191-
undef => $facts['architecture'],
192192
default => $facts['os']['architecture']
193193
}
194194

manifests/adoptium.pp

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -42,21 +42,21 @@
4242
# The name for the optional symlink in the installation directory.
4343
#
4444
define java::adoptium (
45-
$ensure = 'present',
46-
$version_major = undef,
47-
$version_minor = undef,
48-
$version_patch = undef,
49-
$version_build = undef,
50-
$proxy_server = undef,
51-
$proxy_type = undef,
52-
$url = undef,
53-
$basedir = undef,
54-
$manage_basedir = true,
55-
$manage_symlink = false,
56-
$symlink_name = undef,
45+
Enum['present'] $ensure = 'present',
46+
Optional[String] $version_major = undef,
47+
Optional[String] $version_minor = undef,
48+
Optional[String] $version_patch = undef,
49+
Optional[String] $version_build = undef,
50+
Optional[String] $proxy_server = undef,
51+
Optional[Enum['none', 'http', 'https', 'ftp']] $proxy_type = undef,
52+
Optional[String] $url = undef,
53+
Optional[String] $basedir = undef,
54+
Boolean $manage_basedir = true,
55+
Boolean $manage_symlink = false,
56+
Optional[String] $symlink_name = undef,
5757
) {
5858
# archive module is used to download the java package
59-
include ::archive
59+
include archive
6060

6161
$install_path = "jdk-${version_major}.${version_minor}.${version_patch}+${version_build}"
6262

@@ -93,7 +93,6 @@
9393

9494
# set java architecture nomenclature
9595
$os_architecture = $facts['os']['architecture'] ? {
96-
undef => $facts['architecture'],
9796
default => $facts['os']['architecture']
9897
}
9998

manifests/download.pp

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -54,21 +54,21 @@
5454
# The name for the optional symlink in the installation directory.
5555
#
5656
define java::download (
57-
$ensure = 'present',
58-
$version = '8',
59-
$version_major = undef,
60-
$version_minor = undef,
61-
$java_se = 'jdk',
62-
$proxy_server = undef,
63-
$proxy_type = undef,
64-
$url = undef,
65-
$jce = false,
66-
$jce_url = undef,
67-
$basedir = undef,
68-
$manage_basedir = false,
69-
$package_type = undef,
70-
$manage_symlink = false,
71-
$symlink_name = undef,
57+
Enum['present'] $ensure = 'present',
58+
String[1] $version = '8',
59+
Optional[String] $version_major = undef,
60+
Optional[String] $version_minor = undef,
61+
String[1] $java_se = 'jdk',
62+
Optional[String] $proxy_server = undef,
63+
Optional[Enum['none', 'http', 'https', 'ftp']] $proxy_type = undef,
64+
Optional[String] $url = undef,
65+
Boolean $jce = false,
66+
Optional[String] $jce_url = undef,
67+
Optional[String] $basedir = undef,
68+
Boolean $manage_basedir = false,
69+
Optional[String] $package_type = undef,
70+
Boolean $manage_symlink = false,
71+
Optional[String] $symlink_name = undef,
7272
) {
7373
# archive module is used to download the java package
7474
include archive

manifests/init.pp

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,15 @@
3636
# environment variable.
3737
#
3838
class java (
39-
String $distribution = 'jdk',
40-
Pattern[/present|installed|latest|^[.+_0-9a-zA-Z:~-]+$/] $version = 'present',
41-
Optional[String] $package = undef,
42-
Optional[Array] $package_options = undef,
43-
Optional[String] $java_alternative = undef,
44-
Optional[String] $java_alternative_path = undef,
45-
Optional[String] $java_home = undef
39+
String $distribution = 'jdk',
40+
Pattern[/present|installed|latest|^[.+_0-9a-zA-Z:~-]+$/] $version = 'present',
41+
Optional[String] $package = undef,
42+
Optional[Array] $package_options = undef,
43+
Optional[String] $java_alternative = undef,
44+
Optional[String] $java_alternative_path = undef,
45+
Optional[String] $java_home = undef
4646
) {
47-
include ::java::params
47+
contain java::params
4848

4949
$default_package_name = has_key($java::params::java, $distribution) ? {
5050
false => undef,
@@ -118,12 +118,10 @@
118118
}
119119
}
120120

121-
anchor { 'java::begin:': }
122-
-> package { 'java':
121+
package { 'java':
123122
ensure => $version,
124123
install_options => $package_options,
125124
name => $use_java_package_name,
126125
}
127126
-> class { 'java::config': }
128-
-> anchor { 'java::end': }
129127
}

manifests/sap.pp

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
# /usr/lib/jvm for Debian and /usr/java for RedHat.
2727
#
2828
# @param manage_basedir
29-
# Whether to manage the basedir directory. Defaults to false.
29+
# Whether to manage the basedir directory.
3030
# Note: /usr/lib/jvm is managed for Debian by default, separate from this parameter.
3131
#
3232
# @param manage_symlink
@@ -36,19 +36,19 @@
3636
# The name for the optional symlink in the installation directory.
3737
#
3838
define java::sap (
39-
$ensure = 'present',
40-
$version = '8',
41-
$version_full = undef,
42-
$java = 'jdk',
43-
$proxy_server = undef,
44-
$proxy_type = undef,
45-
$basedir = undef,
46-
$manage_basedir = true,
47-
$manage_symlink = false,
48-
$symlink_name = undef,
39+
Enum['present'] $ensure = 'present',
40+
String[1] $version = '8',
41+
Optional[String] $version_full = undef,
42+
String[1] $java = 'jdk',
43+
Optional[String] $proxy_server = undef,
44+
Optional[Enum['none', 'http', 'https', 'ftp']] $proxy_type = undef,
45+
Optional[String] $basedir = undef,
46+
Boolean $manage_basedir = true,
47+
Boolean $manage_symlink = false,
48+
Optional[String] $symlink_name = undef,
4949
) {
5050
# archive module is used to download the java package
51-
include ::archive
51+
include archive
5252

5353
# validate java edition to download
5454
if $java !~ /(jre|jdk)/ {
@@ -128,7 +128,6 @@
128128
}
129129

130130
$_os_architecture = $facts['os']['architecture'] ? {
131-
undef => $facts['architecture'],
132131
default => $facts['os']['architecture']
133132
}
134133

0 commit comments

Comments
 (0)