Version information
This version is compatible with:
Start using this module
Add this module to your Puppetfile:
mod 'ericohtake-javaplugin64', '8.91.0'
Learn more about managing modules with a PuppetfileDocumentation
Java Plugin 64 - Install Module for Puppet
Table of Contents
Overview
This module installs the most recent version of Java Plugin 64-bits (JRE). Version 8 update 91.
It also removes some older versions, as for example version 8 update 77. To see the full list, please refer to the reference section at the end of this page.
Module Description
The module javaplugin64 solves the installation challenge that Java Runtime Environment presents to us.
To install a Java Plugin is pretty simple, however, a newer installation doesn't remove/upgrades the older versions automatically, which makes versions of Java to pile up in the system. (Interactive mode gives you a warning of outdated versions.)
To make things even more challenging, to silent uninstall Java Plugins, we must provide the uninstall string found in Windows Registry and for each version the string changes.
This module finds out first, what is the version current installed in the system, and then provide an uninstall string if this version is meant to be uninstalled.
For clarity sake, the module only removes the versions provided in the javaplugin64::params
class, but don't worry, you can provide your own requirements and uninstall strings there.
To solve this problem a facter fact was created to run against the registry collecting versions of Java Plugin installed in a system.
The main class javaplugin64
installs the latest Java version informed in the parameters.
After the installation, if another version of Java Plugin is found, the uninstaller class javaplugin64::uninstall
is called which has its parameters fed by a case statement in the javaplugin64::params
class.
Then, 2 messages will be issued, one stating the version that was uninstalled, and another saying the recent version was found in the system.
Setup
What javaplugin64 affects
-
It will create a new facter fact in the system exposing versions of Java Plugin 64-Bits installed in the system.
-
It installs a Java Plugin 64 bits in the system.
-
It will uninstall a Java Plugin version that matches the parameters found in
javaplugin64::params
-
It might overwrite a Java Plugin configuration in a system. For example security prompts and turning on updates notification.
Setup Requirements
-
Since this module depends 100% on the facter fact
$::javaplugin64
pluginsync must be enabled. -
For local installation, you will need to place the installer at
C:\apps\plugins\java64\
or override the parameterjavaplugin64::params::source_path
-
If the installer source comes from a network path, make sure the systems running the Puppet agent have full access to it.
-
If you need to uninstall a version that is not listed in the classes available, add it to the
javaplugin64::params
class.
Beginning with javaplugin64
-
To test, copy the module to your module path, and run
puppet apply
on its examples folder. -
Or after copying the module to your module path, classify your nodes in your the
site.pp file
. -
Put the installer on the folder
C:\apps\plugins\java64\jre-8u71-windows-x64.exe
. -
Or provide your installer source path overriding
$javaplugin64::params::source_path
param.
Usage
- If you place the Java Plugin installer in the default source folder, you just need to include the class in your
site.pp
file:
# C:\ProgramData\PuppetLabs\code\environments\production\manifests\site.pp
#
# Default installer folder and most recent Java Plugin name:
# C:\apps\plugins\java64\jre-8u91-windows-x64.exe
node 'default' {
class { 'javaplugin64': }
}
- Do you have a different installer source folder or file name? No problem! Override the
$javaplugin64::params::source_path
parameter:
node 'default' {
class { 'javaplugin64':
source_path => 'C:\users\you\desktop\jre-8u91-windows-x64.exe',
}
}
- When a new version of Java Plugin is available, (or the silent install switch changes) you just need to override the parameters:
node 'default' {
class { 'javaplugin64':
pkg_name => 'Java 9 Update 91 (64-bit)',
source_path => 'C:\apps\plugins\java64\jre-9u91-windows-x64.exe',
install_options => "/q",
}
}
-
For example, run
puppet apply C:\ProgramData\PuppetLabs\code\environments\production\manifests
to install Java during tests and then follow the workflow to test with your ENC before deploying into production. -
This module has been tested on Foreman and Puppet Enterprise executed well on 300+ nodes running Windows 7 and Windows 10
-
You may want to remove some lines of code from the
javaplugin64::params
class that are not relevant to your infrastructure. For example, versions of Java that you don't have.
Expanding
When to expand
-
You will want to expand this module when a new version of Java Plugin is released or when you want to uninstall a version that is not present in the
javaplugin64::params
class. -
However, I will try to maintain this module updated in line with Java Plugin releases as long as I have the opportunity.
-
To make this module capable of removing another Java Plugin version, find out the uninstall string for the version you want to remove, then add it to the case statement at
javaplugin64::params
It is not possible to override the parameters for the uninstaller, since it is only executed after an include on thejavaplugin64
class.
class javaplugin64::params {
$pkg_name = 'Java 8 Update 91 (64-bit)'
$source_path = 'C:\apps\plugins\java64\jre-8u91-windows-x64.exe'
$install_options = '/s'
$current_version_message = 'The most recent version of Java is installed!'
case $::javaplugin64 {
/\.*Java 8 Update 77/: {
$uninstall_string = '{26A24AE4-039D-4CA4-87B4-2F86418077FF}'
$uninstall_message = 'The version 8 update 60 was uninstalled'
}
/\.*Java 8 Update 65/: {
$uninstall_string = '{26A24AE4-039D-4CA4-87B4-2F86418065FF}'
$uninstall_message = 'The version 8 update 65 was uninstalled'
}
/\.*Java 8 Update 51/: {
$uninstall_string = '{26A24AE4-039D-4CA4-87B4-2F86418051FF}'
$uninstall_message = 'The version 8 update 51 was uninstalled'
}
default: {}
}
}
Reference
-
Version installed by this module:
- Java Plugin 8 Update 91 (64-bit)
-
Versions uninstalled by this module:
- Please check the
params.pp
file.
- Please check the
-
Facter fact included under
lib\facter
folder$::javaplugin64
-
Parameters that can be overridden:
$pkg_name
$source_path
$install_options
-
Classes
javaplugin64
javaplugin64::params
javaplugin64::uninstall
javaplugin64::current_version_message
Limitations
- This module manages only Java Plugin 64-Bits versions.
- You cannot override parameters for the uninstaller.
Development
- You can clone this module and if you want to add features to it, please, send a pull request.
- You can fork it and post your own version.
2016-04-24 Release 8.91.0
Summary
Features
-
Added installation of new Java Plugin 8 Update 91 (64-bit)
-
Added string to uninstall outdated Java Plugin 8 Update 77 (64-bit)
2016-04-09 Release 8.77.0
Summary
Features
-
Added installation of new Java Plugin 8 Update 77 (64-bit)
-
Added string to uninstall outdated Java Plugin 8 Update 73 (64-bit)
Others
- The version numbering changed to follow the Java release versions. The last digit will be used for the minor changes in the same version of this module.
2016-02-21 Release 2.0.0
Summary
Features
-
Added installation of new Java Plugin 8 Update 73 (64-bit)
-
Added string to uninstall outdated Java Plugin 8 Update 71 (64-bit)
2016-01-23 Release 1.0.0
Summary
Features
-
Added installation of new Java Plugin 8 Update 71 (64-bit)
-
Added string to uninstall outdated Java Plugin 8 Update 66 (64-bit)
Bugfixes
- Fixed issue with uninstall strings with wrong end character
Dependencies
- puppetlabs/stdlib (>= 1.0.0 < 5.0.0)