don_rumata.ansible_role_install_liberica_java

Ansible Role: Install Liberica Java

License Ansible Galaxy CircleCI Ansible Galaxy Quality Ansible Galaxy Release

This role installs Liberica Java on Linux and Windows.

Supported Platforms

Operating Systems

  platforms:
    - name: Fedora
      versions:
        - 31
        - 32
    - name: Ubuntu
      versions:
        - xenial
        - bionic
        - focal
    - name: Debian
      versions:
        - jessie
        - stretch
        - buster
        - oldstable
        - stable
        - testing
    - name: EL (CentOS)
      versions:
        - 8
    - name: openSUSE
      versions:
        - tumbleweed
        - 15.1
    - name: Windows
      versions:
        - 2008x64 (7 64bit)
        - 2008x86 (7 32bit)
        - 2019 (10 64bit)

Requirements

Minimum Ansible version: 2.9

In the Ansible controller, ensure you have: python-jmespath

Role Variables

liberica_api_version: 1
liberica_api_releases_url: https://api.bell-sw.com/v{{ liberica_api_version }}/liberica/releases

liberica_gpg_key_url: https://download.bell-sw.com/pki/GPG-KEY-bellsoft

# If not defined, the latest supported LTS will be chosen.
# liberica_java_version: 11

# Definitions:
# LTS: Long Term Support.
# EOL: End Of Life.
# GA: General Availability.
# EA: Early Access.
# Bitness: 64 or 32-bit architecture.
# Versions include feature, interim, patch, and build as per OpenJDK community document JEP 322.

# General Settings
liberica_java_architecture: x86
liberica_java_bundletype: jdk-full
liberica_java_eol: 'false'
liberica_java_lts: 'true'
liberica_java_ga: 'true'
liberica_java_latestlts: 'true'

# Windows Specific Settings
liberica_win_packagetype: msi
liberica_win_installationtype: installer
liberica_win_bitness: 64
liberica_win_architecture: x86

# Custom download URL for msi-installer
# liberica_win_download_url: http://10.10.10.10/soft/bellsoft/liberica/latestlts/bellsoft-jdk-latest-windows-amd64-full.msi

# About bundle types
# jdk - full Liberica JDK package (without JavaFX).
# jdk-full - full Liberica JDK package (with JavaFX).
# jdk-lite - Liberica JDK with compressed modules, no extra packages.
# jre - Java SE Runtime Environment only.
# jre-full - Java SE Runtime Environment with JavaFX.

liberica_checksum_algorithm: 'sha1'

# Use "https" if you do not use a caching proxy.
http_or_https: http
# http_or_https: https

liberica_windows_local_download_path: '{{ ansible_env.TMP }}\liberica'

For Windows 7 Installation

Download and install Windows Management Framework 5.1.

How To

To set up WinRM for Windows quickly: https://ru.stackoverflow.com/a/949971/191416

Installing the Role

Using ansible-galaxy:

ansible-galaxy install don_rumata.ansible_role_install_liberica_java

Using bash+git:

mkdir -p "$HOME/.ansible/roles"
cd "$HOME/.ansible/roles"
git clone https://github.com/don-rumata/ansible-role-install-liberica-java don_rumata.ansible_role_install_liberica_java

Example Playbooks

Example I

To install the latest stable LTS version of JRE+JDK+JavaFX on Windows or Linux:

install-liberica-java.yml:

- name: Install Liberica Java
  hosts: all
  strategy: free
  serial:
    - "100%"
  roles:
    - don_rumata.ansible_role_install_liberica_java
  tasks:

Example II

To install only Java SE Runtime Environment v8:

install-liberica-java.yml:

- name: Install Liberica Java
  hosts: all
  strategy: free
  serial:
    - "100%"
  roles:
    - don_rumata.ansible_role_install_liberica_java
  vars:
    liberica_java_version: 8
    liberica_java_bundletype: jre
  tasks:

Example III

To install only the JRE v8, Liberica JDK with compressed modules and Server VM v11, and full Liberica JDK without JavaFX v14 on both Linux and Windows:

my-inventory.ini:

[linux-hosts]
ubuntu.local

[win-hosts]
win7-64

install-liberica-java.yml:

- name: Install Liberica Java
  hosts: all
  strategy: free
  serial:
    - "100%"
  roles:
    - role: don_rumata.ansible_role_install_liberica_java
      liberica_java_version: 8
      liberica_java_bundletype: jre
    - role: don_rumata.ansible_role_install_liberica_java
      liberica_java_version: 11
      liberica_java_bundletype: jdk-lite
    - role: don_rumata.ansible_role_install_liberica_java
      liberica_java_version: 14
      liberica_java_bundletype: jdk
  tasks:

Run the playbook:

ansible-playbook -i ./my-inventory.ini ./install-liberica-java.yml

Expected result:

aptitude search bellsoft

Output:

p   bellsoft-java11                                           - BellSoft Liberica is a build of OpenJDK.
p   bellsoft-java11-full                                      - BellSoft Liberica is a build of OpenJDK.
i   bellsoft-java11-lite                                      - BellSoft Liberica is a build of OpenJDK.
p   bellsoft-java11-runtime                                   - BellSoft Liberica is a build of OpenJDK.
p   bellsoft-java11-runtime-full                              - BellSoft Liberica is a build of OpenJDK.
p   bellsoft-java12                                           - BellSoft Liberica is a build of OpenJDK.
p   bellsoft-java12-lite                                      - BellSoft Liberica is a build of OpenJDK.
p   bellsoft-java13                                           - BellSoft Liberica is a build of OpenJDK.
p   bellsoft-java13-full                                      - BellSoft Liberica is a build of OpenJDK.
p   bellsoft-java13-lite                                      - BellSoft Liberica is a build of OpenJDK.
p   bellsoft-java13-runtime                                   - BellSoft Liberica is a build of OpenJDK.
p   bellsoft-java13-runtime-full                              - BellSoft Liberica is a build of OpenJDK.
i   bellsoft-java14                                           - BellSoft Liberica is a build of OpenJDK.
p   bellsoft-java14-full                                      - BellSoft Liberica is a build of OpenJDK.
p   bellsoft-java14-lite                                      - BellSoft Liberica is a build of OpenJDK.
p   bellsoft-java14-runtime                                   - BellSoft Liberica is a build of OpenJDK.
p   bellsoft-java14-runtime-full                              - BellSoft Liberica is a build of OpenJDK.
p   bellsoft-java8                                            - BellSoft Liberica is a build of OpenJDK.
p   bellsoft-java8-full                                       - BellSoft Liberica is a build of OpenJDK.
i   bellsoft-java8-runtime                                    - BellSoft Liberica is a build of OpenJDK.
p   bellsoft-java8-runtime-full                               - BellSoft Liberica is a build of OpenJDK.

Liberica Java in Windows 7

License

This project is licensed under the Apache License, Version 2.0.

Author Information

Created by don Rumata.

TODO

  • Add tests.
  • Add more tests.

Acknowledgments

Special thanks to Aleksei Voitylov.

Installa
ansible-galaxy install don_rumata.ansible_role_install_liberica_java
Licenza
apache-2.0
Download
75
Proprietario
Здесь все бесполезно. Знаний не хватает, а золото теряет цену, потому что опаздывает.