Role Detail

geerlingguy.java

Java for Linux
Downloads
132586
Type Ansible
Minimum Ansible Version 2.4
Installation $ ansible-galaxy install geerlingguy.java
Tags
development
java
jdk
openjdk
oracle
system
web
Last Commit
Last Imported
Version History
Version Release Date
1.8.1
1.8.0
1.7.7
1.7.6
1.7.5
1.7.4
1.7.3
1.7.2
1.7.1
1.7.0
1.6.0
1.5.1
1.5.0
1.4.1
1.4.0
1.3.0
1.2.1
1.2.0
1.1.1
1.1.0
1.0.4
1.0.3
1.0.2
1.0.1
1.0.0
OS Platforms
Platform Version
Debian jessie
Debian stretch
Debian wheezy
EL 6
EL 7
Fedora 16
Fedora 17
Fedora 18
Fedora 19
Fedora 20
Fedora 21
Fedora 22
Fedora 23
Fedora 24
Fedora 25
Fedora 26
Fedora 27
Fedora 28
FreeBSD 10.2
Ubuntu bionic
Ubuntu precise
Ubuntu trusty
Ubuntu xenial
Last 10 Imports
Completed Status
SUCCESS
SUCCESS
SUCCESS
SUCCESS
SUCCESS
SUCCESS
SUCCESS
SUCCESS
SUCCESS
SUCCESS

Ansible Role: Java

Build Status

Installs Java for RedHat/CentOS and Debian/Ubuntu linux servers.

Requirements

None.

Role Variables

Available variables are listed below, along with default values:

# The defaults provided by this role are specific to each distribution.
java_packages:
  - java-1.7.0-openjdk

Set the version/development kit of Java to install, along with any other necessary Java packages. Some other options include are included in the distribution-specific files in this role's 'defaults' folder.

java_home: ""

If set, the role will set the global environment variable JAVA_HOME to this value.

Dependencies

None.

Example Playbook (using default package, usually OpenJDK 7)

- hosts: servers
  roles:
    - geerlingguy.java

Example Playbook (install OpenJDK 8)

For RHEL / CentOS:

- hosts: server
  roles:
    - role: geerlingguy.java
      when: "ansible_os_family == 'RedHat'"
      java_packages:
        - java-1.8.0-openjdk

For Ubuntu < 16.04:

- hosts: server
  tasks:
    - name: installing repo for Java 8 in Ubuntu
      apt_repository: repo='ppa:openjdk-r/ppa'

- hosts: server
  roles:
    - role: geerlingguy.java
      when: "ansible_os_family == 'Debian'"
      java_packages:
        - openjdk-8-jdk

License

MIT / BSD

Author Information

This role was created in 2014 by Jeff Geerling, author of Ansible for DevOps.

None