Coder Social home page Coder Social logo

adarshabairy / oracle-java Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ansiblebit/oracle-java

0.0 1.0 0.0 286 KB

Ansible role to install Oracle Java 8/11 on Debian and RedHat based distributions.

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

License: BSD 3-Clause "New" or "Revised" License

Ruby 20.67% Python 11.22% Shell 68.11%

oracle-java's Introduction

ansiblebit.oracle-java

License Build Status

Platform Platform Platform Platform

Project Stats

An Ansible role to setup Oracle Java Development Kit.

DISCLAIMER: usage of any version of this role implies you have accepted the Oracle Binary Code License Agreement for Java SE.

Tests

Family Distribution Version Test Status
Debian Debian Jessie x86_64
Debian Debian Stretch x86_64
Debian Ubuntu Precise x86_64
Debian Ubuntu Yakkety x86_64
Debian Ubuntu Xenial x86_64
Debian Ubuntu Trusty x86_64
Debian Ubuntu Vivid x86_64
Debian Ubuntu Wily x86_64
Debian Ubuntu Artful x86_64
Debian Ubuntu Bionic x86_64
Debian Ubuntu Cosmic x86_64
RedHat Centos 7 x86_64

Requirements

  • ansible >= 2.x

Facts

  • oracle_java_installed: fact set by this role that contains a flag that indicates if Java is installed on the host.
  • oracle_java_version_installed: fact set by this role that contains the string of the Java version installed in the system.

Role Variables

  • debug: flag to make role more verbose.
  • oracle_java_set_as_default: flag to indicate if this play should set Java as default (default: yes).
  • oracle_java_use_defaults: flag to indicate you want to use defaults set in the defaults directory (default: yes). WARNING. setting this to no will require the user to pass all of the distribution variables. See * | Java 8 examples in the Playbooks section.

Debian

WARNING to override any of the following variables (even if it's only one), you'll need to set oracle_java_use_defaults: no and override all of their values since OS family defaults will no longer be loaded. See debian | Java 8 example in the Playbooks section.

  • oracle_java_apt_repository: Personal Package Archive (PPA) from where to install Java.
  • oracle_java_apt_repository_key: PPA repository key.
  • oracle_java_cache_valid_time: the amount of time in seconds the apt cache is valid.
  • oracle_java_deb_package: name of debian package.
  • oracle_java_debconf_package_default: name of debconf package to set default.
  • oracle_java_home: the location of the Java home directory.
  • oracle_java_state:** the package state (see Ansible apt module for more information).

Debian/Ubuntu

WARNING to override any of the following variables (even if it's only one), you'll need to set oracle_java_use_defaults: no and override all of their values since OS family defaults will no longer be loaded. See debian | ubuntu | Java 8 example in the Playbooks section.

  • oracle_java_apt_repository: Personal Package Archive (PPA) from where to install Java.
  • oracle_java_cache_valid_time: the amount of time in seconds the apt cache is valid.
  • oracle_java_deb_package: name of debian package.
  • oracle_java_debconf_package_default: name of debconf package to set default.
  • oracle_java_home: the location of the Java home directory.
  • oracle_java_license_version: which Oracle license version you will be accepting.
  • oracle_java_state:** the package state (see Ansible apt module for more information).

Redhat-only

WARNING to override any of the following variables (even if it's only one), you'll need to set oracle_java_use_defaults: no and override all of their values since OS family defaults will no longer be loaded. See redhat | centos 7 | Java 8 example in the Playbooks section.

  • oracle_java_dir_source: directory where to store the RPM files.
  • oracle_java_download_timeout: download timeout, in seconds.
  • oracle_java_home: the location of the Java home directory.
  • oracle_java_rpm_filename: file name used for the download destination.
  • oracle_java_rpm_url: where to download the rpm from.
  • oracle_java_rpm_validate_certs: flag to indicate if you want SSL certificate validation.
  • oracle_java_version_string: the Java version string to verify installation against.

Playbooks

# generic
- hosts: servers
  roles:
      - role: ansiblebit.oracle-java

# debian | Java 11
- hosts: servers
  roles:
      - role: ansiblebit.oracle-java

## explicitely passing default parameters
- hosts: servers
  roles:
      - role: ansiblebit.oracle-java

# debian | Java 8
- hosts: servers
  roles:
      - role: ansiblebit.oracle-java
        oracle_java_use_defaults: no
        oracle_java_apt_repository: 'deb http://ppa.launchpad.net/webupd8team/java/ubuntu bionic main'
        oracle_java_apt_repository_key: 'EA8CACC073C3DB2A'
        oracle_java_cache_valid_time: 3600
        oracle_java_deb_package: 'oracle-java8-installer'
        oracle_java_debconf_package_default: 'oracle-java8-set-default'
        oracle_java_home: "/usr/lib/jvm/java-8-oracle"
        oracle_java_license_version: "shared/accepted-oracle-license-v1-1"
        oracle_java_set_as_default: no
        oracle_java_state: latest

# debian | ubuntu | Java 11
- hosts: servers
  roles:
      - role: ansiblebit.oracle-java

# debian | ubuntu | Java 8
- hosts: servers
  roles:
      - role: ansiblebit.oracle-java
        oracle_java_use_defaults: no
        oracle_java_apt_repository: "ppa:webupd8team/java"
        oracle_java_cache_valid_time: 3600
        oracle_java_deb_package: 'oracle-java8-installer'
        oracle_java_debconf_package_default: 'oracle-java8-set-default'
        oracle_java_home: "/usr/lib/jvm/java-8-oracle"
        oracle_java_license_version: "shared/accepted-oracle-license-v1-1"
        oracle_java_set_as_default: no
        oracle_java_state: latest

# redhat | centos 7 | Java 11
- hosts: servers
  roles:
      - role: ansiblebit.oracle-java

# redhat | centos 7 | Java 8
- hosts: servers
  roles:
      - role: ansiblebit.oracle-java
        oracle_java_use_defaults: no
        oracle_java_dir_source: '/usr/local/src'
        oracle_java_download_timeout: 60  
        oracle_java_rpm_filename: 'jdk-8u191-linux-x64.rpm'
        oracle_java_home: '/usr/java/default'
        oracle_java_os_supported: yes
        oracle_java_rpm_url: 'http://download.oracle.com/otn-pub/java/jdk/8u191-b12/2787e4a523244c269598db4e85c51e0c/jdk-8u191-linux-x64.rpm'
        oracle_java_rpm_validate_certs: yes
        oracle_java_set_as_default: no
        oracle_java_version_string: 1.8.0_191

Use --skip-tags=debug if you want to suppress debug information.


## Test

```bash
tox -e py27-ansible26 -- --box centos7-64.vagrant.dev

tox -e py27-ansible26 -- --box bionic64.vagrant.dev

# manual
source .tox/py27-ansible26/bin/activate
cd tests
vagrant up bionic64.vagrant.dev

bash test_idempotence.sh \
  --box bionic64.vagrant.dev \
  --inventory .vagrant/provisioners/ansible/inventory/vagrant_ansible_inventory

## look at idempotence test logs
less log/bionic64.vagrant.dev_idempotence_py27-ansible26.log

## debug
vagrant ssh bionic64.vagrant.dev

bash test_checkmode.sh \
  --box bionic64.vagrant.dev \
  --inventory .vagrant/provisioners/ansible/inventory/vagrant_ansible_inventory

## look at checkmode test logs
less log/bionic64.vagrant.dev_checkmode_py27-ansible26.log

vagrant destroy bionic64.vagrant.dev

Links

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.