Giter Site home page Giter Site logo

duanqichao / ansible-oracle-java Goto Github PK

View Code? Open in Web Editor NEW

This project forked from william-yeh/ansible-oracle-java

0.0 1.0 0.0 67 KB

An Ansible role that installs Oracle JDK, in the format for Ansible Galaxy.

Home Page: https://galaxy.ansible.com/williamyeh/oracle-java/

License: Apache License 2.0

Shell 100.00%

ansible-oracle-java's Introduction

williamyeh.oracle-java for Ansible Galaxy

Build Status Circle CI

Summary

Role name in Ansible Galaxy: williamyeh.oracle-java

This Ansible role has the following features for Oracle JDK:

  • Install JDK 7 or 8 version.
  • Install optional Java Cryptography Extensions (JCE)
  • Install for CentOS, Debian/Ubuntu, SUSE, and Mac OS X families.

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

Role Variables

Mandatory variables

None.

Optional variables

User-configurable defaults:

# which version?
java_version: 8

# which subversion?
java_subversion: 112

# which directory to put the download file?
java_download_path: /tmp

# rpm/tar.gz file location:
#   - true: download from Oracle on-the-fly;
#   - false: copy from `{{ playbook_dir }}/files` on the control machine.
java_download_from_oracle: true

# remove temporary downloaded files?
java_remove_download: true

# set $JAVA_HOME?
java_set_javahome: false

# install JCE?
java_install_jce: false

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

If you want to install a Java release which is not supported out-of-the-box, you have to specify the corresponding Java build number in the variable java_build in addition to java_version and java_subversion, e.g.

---
- hosts: all

  roles:
    - williamyeh.oracle-java

  vars:
    java_version: 8
    java_subversion: 91
    java_build: 14

Customized variables, if absolutely necessary

If you have a pre-downloaded jdk_tarball_file whose filename cannot be inferred successfully by tasks/set-role-variables.yml, you may specify it explicitly:

# Specify the pre-fetch filename (without tailing .tar.gz or .rpm or .dmg);
# used in conjunction with `java_download_from_oracle: false`.

jdk_tarball_file

# For example, if you have a `files/jdk-7u79-linux-x64.tar.gz` locally,
# but the filename cannot be inferred successfully by `tasks/set-role-variables.yml`,
# you may specify the following variables in your playbook:
#
#    java_version:    7
#    java_subversion: 79
#    java_download_from_oracle: false
#    jdk_tarball_file: jdk-7u79-linux-x64
#

Usage

Step 1: add role

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

Step 2: add variables

Set vars in your playbook file.

Simple example:

---
# file: simple-playbook.yml

- hosts: all

  roles:
    - williamyeh.oracle-java

  vars:
    java_version: 8

(Optionally) pre-fetch .rpm and .tar.gz files

For some reasons, you may want to pre-fetch .rpm and .tar.gz files before the execution of this role, instead of downloading from Oracle on-the-fly.

To do this, put the file on the {{ playbook_dir }}/files directory in advance, and then set the java_download_from_oracle variable to false:

---
# file: prefetch-playbook.yml

- hosts: all

  roles:
    - williamyeh.oracle-java

  vars:
    java_version: 8
    java_download_from_oracle: false

Dependencies

License

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

History

Rewritten from my pre-Galaxy version: server-config-template.

ansible-oracle-java's People

Contributors

daytong avatar martinthegeek avatar mbautin avatar mmannerm avatar soniah avatar thomasdarimont avatar tjuerge avatar turkenh avatar verhage avatar william-yeh avatar

Watchers

 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.