jebovic.java
Java
Install and Set Up Java
This role is part of my OPS project. Click the link to see it in action. OPS includes many tools, such as a Vagrant file for development virtual machines, playbooks for managing roles, inventory files, examples of role configurations, an Ansible configuration file, and more.
Compatibility
Tested on:
- Debian Jessie (8 and above)
- Ubuntu Trusty (14.04 LTS)
- Ubuntu Xenial (16.04 LTS)
Role Variables
# Configuration for Java installation
java_apt_repositories: []
java_packages:
- "{% if (ansible_distribution == 'Ubuntu' and ansible_distribution_version | version_compare('15.10', '>=')) %}openjdk-8-jre{% else %}openjdk-7-jre{% endif %}"
java_home: no
Example Playbook
- hosts: servers
roles:
- { role: jebovic.java }
Example Configuration
# Choose a custom apt repository
java_apt_repositories:
- "{% if (ansible_distribution == 'Ubuntu') %}ppa:openjdk-r/ppa{% else %}deb http://http.debian.net/debian jessie-backports main{% endif %}"
# Install the desired version (for example, Java 8)
java_packages:
- openjdk-8-jre
Tags
- java_config: only updates JAVA_HOME
License
MIT License
Author Information
Jérémy Baumgarth GitHub Profile
Installa
ansible-galaxy install jebovic.java
Licenza
mit
Download
1.1k
Proprietario