Ansible: Install Oracle Java

Most of my machines are provisioned through Ansible and also most require a running JDK. To support this process, I created an Ansible Role to install the JDK.


You can either use ansible-galaxy to install this role:

ansible-galaxy install

Or checkout this git-repository to your roles directory:

git clone deveth0.oracle_java


You can configure which java-version to use:

oracle_java_version: 8

By default the Java environment variables are set:

oracle_java_set_default: True


- hosts: foo
    - role:
      oracle_java_version: 7

Related Posts