nycrecords.java
Ansible Role: Java
This role installs Java on RedHat/CentOS and Debian/Ubuntu Linux servers.
Requirements
No special requirements.
Role Variables
Here are the variables you can use, along with their default settings:
# The default Java package is different for each Linux distribution.
java_packages:
- java-1.8.0-openjdk
You can specify the version of Java you want to install and any other required Java packages. More options are available in the distribution-specific files in this role's 'defaults' folder.
java_home: ""
If you set this variable, the role will create a global environment variable called JAVA_HOME
with this value.
Dependencies
None required.
Example Playbook (default package)
- hosts: servers
roles:
- role: geerlingguy.java
become: yes
Example Playbook (installing 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: Adding repository for Java 8 on 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 first created in 2014 by Jeff Geerling, the author of Ansible for DevOps.
It was updated by Joel Castillo for the NYC Department of Records and Information Services.
Installa
ansible-galaxy install nycrecords.java
Licenza
mit
Download
965
Proprietario