homeserver/roles/geerlingguy.java
mg 181da3c38a Aufbau Jenkins (#80)
keepass

vars

playbook

jenkins

java

jenkins in inventory

Co-authored-by: Michael Grote <michael.grote@posteo.de>
Reviewed-on: mg/ansible#80
Co-Authored-By: mg <mg@noreply.git.mgrote.net>
Co-Committed-By: mg <mg@noreply.git.mgrote.net>
2021-05-05 10:59:05 +02:00
..
.github Aufbau Jenkins (#80) 2021-05-05 10:59:05 +02:00
defaults Aufbau Jenkins (#80) 2021-05-05 10:59:05 +02:00
meta Aufbau Jenkins (#80) 2021-05-05 10:59:05 +02:00
molecule/default Aufbau Jenkins (#80) 2021-05-05 10:59:05 +02:00
tasks Aufbau Jenkins (#80) 2021-05-05 10:59:05 +02:00
templates Aufbau Jenkins (#80) 2021-05-05 10:59:05 +02:00
vars Aufbau Jenkins (#80) 2021-05-05 10:59:05 +02:00
.ansible-lint Aufbau Jenkins (#80) 2021-05-05 10:59:05 +02:00
.gitignore Aufbau Jenkins (#80) 2021-05-05 10:59:05 +02:00
.yamllint Aufbau Jenkins (#80) 2021-05-05 10:59:05 +02:00
LICENSE Aufbau Jenkins (#80) 2021-05-05 10:59:05 +02:00
README.md Aufbau Jenkins (#80) 2021-05-05 10:59:05 +02:00

Ansible Role: Java

CI

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.8.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)

- 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 < 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.