Git Product home page Git Product logo

ansible-oracle-java's Introduction

srsp.oracle-java for Ansible Galaxy

Build Status

Summary

Role name in Ansible Galaxy: srsp.oracle-java

This Ansible role has the following features related to the Oracle JDK:

  • Install the latest version of Oracle JDK 8 or 10.
  • Install the optional Java Cryptography Extensions (JCE). NOTE: This is only for JDK 8, as it is no longer required for any JDK version > 8.
  • Install for CentOS, Debian/Ubuntu, SUSE, and macOS operating systems.

Attention: As of April 2018 older versions of JDKs are no longer available publicly on the Oracle website,but you need an Oracle account to download these. This role does not support downloading these old JDKs. This means, that you can only download the latest version of all JDKs that have not yet reached their EOL with this role!

However you can still use this role to install older versions, if you download them and provide them as pre-downloaded file or via http (just define java_mirror accordingly).

This role is based on williamyeh.oracle-java, but I wanted more recent Java versions and decided to drop support for older versions.

If you prefer OpenJDK, try alternatives such as geerlingguy.java or smola.java.

Role Variables

Mandatory variables

None, but it is strongly advised to java_version: 8 or java_version: 10, which would give you the latest version of either one.

Optional variables

User-configurable defaults:

# Java Version
java_version: 8

# Java Subversion
java_subversion: 172

# Whether to download Java from from Oracle directly
# - true: Download from Oracle on-the-fly
# - false: 
#     - If java_download_from_mirror true, try to download from java_mirror
#     - If java_copy_from_local: Copies from `{{ playbook_dir }}/files` on the control machine (without file extension)
java_download_from_oracle: true

# If java_download_from_mirror set to *true* download from a mirror instead of Oracle directly
# - true: Download from mirror
# - false: If java_copy_from_local true copies file from `{{ playbook_dir }}/files` on the control machine if java_copy_from_local set to true
java_download_from_mirror: false

# If you set java_download_from_mirror to true, this mirror will be used. Will automatically generate download file name.
java_mirror: "https://private-repo.com/java/jdk-8u172-macosx-x64.dmg"

# Whether to copy from a local file instead of Oracle directly
# - true: Copies from `{{ playbook_dir }}/files` on the control machine (without file extension)
# - false: Doesn't do anything
java_copy_from_local: false

# Remove temporary downloaded files?
java_remove_download: true

# Set $JAVA_HOME?
java_set_java_home: false

# Install JCE?
java_install_jce: false

For other configurable options, read tasks/set-role-variables.yml file; for example, to see supported java_version/java_subversion combinations.

I want to install a JDK which you don't yet support!

No problem! You have to specify the corresponding Java build number in the variables java_build and jdk_tarball_hash in addition to java_version and java_subversion, for example:

- hosts: all

  roles:
    - srsp.oracle-java

  vars:
    - java_version: 8
    - java_subversion: 141
    - java_build: 15
    - jdk_tarball_hash: 336fa29ff2bb4ef291e347e091f7f4a7

JDK 10 variables

If you want to use the latest JDK 10:

- hosts: all

  roles:
    - srsp.oracle-java

  vars:
    - java_version: 10 

JDK 9 variables

JDK 9 is only available in version 9.0.4. If you want to use it, set the following vars and provide it as tarball (see next section):

- hosts: all

  roles:
    - srsp.oracle-java

  vars:
    - java_version: 9 

Usage

Step 1: Add role

Add role name srsp.oracle-java to your playbook file.

Step 2: Add variables

Set variables in your playbook file.

Simple example:

# file: oracle-jdk-playbook.yml

- hosts: all

  roles:
    - srsp.oracle-java

  vars:
    - java_version: 8

(Optionally) pre-fetch .rpm, .tar.gz or .dmg files

You may want to pre-fetch .rpm, .tar.gz or .dmg files before the execution of this role, instead of downloading from Oracle or a mirror

To do this, put the file for your intended system in the {{ playbook_dir }}/files directory:

# file: oracle-jdk-playbook-prefetch.yml

- hosts: all

  roles:
    - srsp.oracle-java

  vars:
    - java_version: 8
    - java_download_from_oracle: false
    - java_copy_from_local: true

If running from the command line

ansible-playbook --ask-become-pass oracle-jdk-playbook.yml

License

Licensed under the Apache License V2.0. See the LICENSE file for details.

ansible-oracle-java's People

Contributors

ag-gh avatar davidjoyce-okta avatar daytong avatar guenhter avatar ibuchanan avatar levonet avatar martinthegeek avatar mbautin avatar mmannerm avatar soniah avatar srsp avatar thomasdarimont avatar tjuerge avatar turkenh avatar verhage avatar william-yeh avatar yuppie-flu avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.