Version information
This version is compatible with:
- , , , ,
Start using this module
Add this module to your Puppetfile:
mod 'oscerd-java', '1.0.2'
Learn more about managing modules with a PuppetfileDocumentation
Puppet Java Module
Introduction
This module install JDK or JRE with puppet
Installation
Clone this repository in a java directory in your puppet module directory
git clone https://github.com/oscerd/puppet-java-module java
Usage
If you include the java::setup class the module will take the package from /java/files
folder, extract his content and move it
in a specific directory (based on the OS we are working on). Here is an example:
java::setup { "java":
type => "jdk",
family => "7",
update_version => "65",
architecture => "x64",
os => "linux",
extension => ".tar.gz",
tmpdir => "",
alternatives => "",
export => ""
}
It's important to define a global search path for the exec
resource to make module work.
This should usually be placed in manifests/site.pp
. It is also important to make sure unzip
and tar
command
are installed on the target system:
Exec {
path => "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
}
package { 'tar':
ensure => installed
}
package { 'unzip':
ensure => installed
}
Parameters
The Puppet Java module use the following parameters in his setup
- Type: Possible values of family are jdk or jre
- Family: Possible values of Java version 6, 7, 8
- Update Version: The update version
- Architecture: The architecture related to the package. Possible values of architecture are i586, x64, sparc, sparcv9 (the last two need to be tested)
- Operating System: The operating system related to the package, at this moment we support linux only
- Extension: The file extension, at this moment is .tar.gz
- Install Directory: The directory where the Apache Tomcat will be installed (default is
/opt/
) - Temp Directory: The directory where the java package will be extracted (default is
/tmp/
) - Alternatives: Possible values are yes, no and undef (default is no). If alternatives have value yes, then the module will make update alternatives to set the correct path to java, javac and javaws (in case of type jdk) or only java (in case of jre)
- Export: Possible values are yes, no and undef (default is no). If export is set on yes, then module will export new JAVA_HOME environment variable.
Testing
The Puppet java module has been tested on the following Operating Systems:
- CentOS 6.5 x64
- Debian 7.5 x64
- Fedora 20.0 x86_64
- Ubuntu 14.04 x64
Contributing
Feel free to contribute by testing, opening issues and adding/changing code
Puppet Forge
The Puppet Java Module has been published on Puppet Forge: https://forge.puppetlabs.com/oscerd/java
License
Copyright 2014 Oscerd and contributors
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.