Skip to content

Commit

Permalink
Default java_declare_method to class for Debian and Ubuntu (#295)
Browse files Browse the repository at this point in the history
Fixes #291
  • Loading branch information
treydock authored Jul 14, 2023
1 parent 84b7c6d commit a4c775b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
1 change: 0 additions & 1 deletion data/os/Debian.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
keycloak::java_declare_method: include
keycloak::java_package: openjdk-17-jdk
keycloak::java_home: /usr/lib/jvm/java-1.17.0-openjdk-amd64/
keycloak::java_alternative_path: /usr/lib/jvm/java-1.17.0-openjdk-amd64/bin/java
Expand Down
3 changes: 3 additions & 0 deletions data/os/Debian/11.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
keycloak::java_package_dependencies:
- ca-certificates-java
10 changes: 10 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
# @param install_dir
# The directory of where to install Keycloak.
# Default is `/opt/keycloak-${version}`.
# @param java_package_dependencies
# Packages to install before Java
# @param java_declare_method
# How to declare the Java class within this module
# The `include` value only includes the java class
Expand Down Expand Up @@ -214,6 +216,7 @@
String $version = '21.0.1',
Optional[Variant[Stdlib::HTTPUrl, Stdlib::HTTPSUrl]] $package_url= undef,
Optional[Stdlib::Absolutepath] $install_dir = undef,
Array[String[1]] $java_package_dependencies = [],
Enum['include','class'] $java_declare_method = 'class',
String[1] $java_package = 'java-11-openjdk-devel',
Stdlib::Absolutepath $java_home = '/usr/lib/jvm/java-11-openjdk',
Expand Down Expand Up @@ -375,6 +378,13 @@
].filter |$s| { $s =~ NotUndef }
$service_start_cmd = join($service_start, ' ')

$java_package_dependencies.each |$package| {
package { $package:
ensure => 'installed',
before => Class['java'],
}
}

if $java_declare_method == 'include' {
contain java
} else {
Expand Down

0 comments on commit a4c775b

Please sign in to comment.