geerlingguy.java

Ansible Role: Java

CI

This role installs Java on RedHat/CentOS, Amazon, and Debian/Ubuntu Linux servers.

Requirements

None.

Role Variables

Here are the available settings, along with their default values:

# The defaults for this role vary based on the Linux distribution.
java_packages:
  - java-1.8.0-openjdk

You can set the version of Java to install and any other required packages. More options are available in the 'defaults' folder of this role, specific to each distribution.

java_home: ""

If you specify a value, the role will set the JAVA_HOME environment variable to this value.

Dependencies

None.

Example Playbook (using default package)

- hosts: servers
  roles:
    - role: geerlingguy.java
      become: yes

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 versions less than 16.04:

- hosts: server
  tasks:
    - name: Install Java 8 repository for 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, the author of Ansible for DevOps.

Installa
ansible-galaxy install geerlingguy.java
Licenza
mit
Download
20.6M
Proprietario
Father, author, developer, maker. Sometimes called "an inflammatory enigma". #stl #drupal #ansible #k8s #raspberrypi #crohns