Skip to content
This repository has been archived by the owner on Jul 10, 2023. It is now read-only.

albert-io/ansible-role-java

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

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.