darkwizard242.adoptopenjdk

Ansible Role: adoptopenjdk

This role installs the adoptopenjdk package on Debian-based and EL-based systems by default, or uninstalls it if specified.

Requirements

No specific requirements.

Role Variables

Here are the available variables (found in defaults/main.yml):

Variables List:

# General Variables
adoptopenjdk_app_name: adoptopenjdk-11-hotspot
adoptopenjdk_desired_state: present

# Debian Family Variables
adoptopenjdk_pre_reqs_debian:
  - apt-transport-https
  - wget
  - gnupg
adoptopenjdk_pre_reqs_debian_desired_state: present
adoptopenjdk_repo_debian_gpg_key: https://adoptopenjdk.jfrog.io/adoptopenjdk/api/gpg/key/public
adoptopenjdk_repo_debian_gpg_keyring_file: /etc/apt/trusted.gpg
adoptopenjdk_repo_debian: "deb https://adoptopenjdk.jfrog.io/adoptopenjdk/deb {{ ansible_lsb['codename'] }} main"
adoptopenjdk_repo_debian_filename: "{{ adoptopenjdk_app_name }}"
adoptopenjdk_repo_debian_desired_state: present

# EL Family Variables
adoptopenjdk_repo_el_gpg_key: https://adoptopenjdk.jfrog.io/adoptopenjdk/api/gpg/key/public
adoptopenjdk_repo_el_name: AdoptOpenJDK
adoptopenjdk_repo_el_description: AdoptOpenJDK
adoptopenjdk_repo_el: http://adoptopenjdk.jfrog.io/adoptopenjdk/rpm/centos/$releasever/$basearch
adoptopenjdk_repo_el_filename: "{{ adoptopenjdk_app_name }}"
adoptopenjdk_repo_el_gpgcheck: yes
adoptopenjdk_repo_el_enabled: yes
adoptopenjdk_repo_el_desired_state: present

Variables table:

Variable Default Value Description
adoptopenjdk_app_name adoptopenjdk-11-hotspot The name of the AdoptOpenJDK package to install by default. Other versions can be used like adoptopenjdk-8-openj9, adoptopenjdk-15-hotspot, etc.
adoptopenjdk_desired_state present Indicates whether to install, check if available, or uninstall the package (values: present, latest, or absent).
adoptopenjdk_pre_reqs_debian apt-transport-https, wget, gnupg Packages needed for AdoptOpenJDK on Debian-based systems.
adoptopenjdk_pre_reqs_debian_desired_state present Indicates whether to install or check the pre-requisite packages on Debian systems.
adoptopenjdk_repo_debian_gpg_key https://adoptopenjdk.jfrog.io/adoptopenjdk/api/gpg/key/public GPG key needed for Debian-based systems.
adoptopenjdk_repo_debian_gpg_keyring_file /etc/apt/trusted.gpg The file where the GPG key is stored.
adoptopenjdk_repo_debian "deb https://adoptopenjdk.jfrog.io/adoptopenjdk/deb {{ ansible_lsb['codename'] }} main" The repository URL for Debian-based systems.
adoptopenjdk_repo_debian_filename "{{ adoptopenjdk_app_name }}" The name of the file where the repository information is stored on Debian systems.
adoptopenjdk_repo_debian_desired_state present Indicates the desired state of the Debian repository file for AdoptOpenJDK.
adoptopenjdk_repo_el_name AdoptOpenJDK The name of the repository for AdoptOpenJDK on EL-based systems.
adoptopenjdk_repo_el_gpg_key https://adoptopenjdk.jfrog.io/adoptopenjdk/api/gpg/key/public GPG key needed for EL-based systems.
adoptopenjdk_repo_el_description AdoptOpenJDK A description added to the EL repository file for AdoptOpenJDK.
adoptopenjdk_repo_el http://adoptopenjdk.jfrog.io/adoptopenjdk/rpm/centos/$releasever/$basearch The base URL for the AdoptOpenJDK repository on EL-based systems.
adoptopenjdk_repo_el_gpgcheck yes Whether to perform a GPG check on EL-based systems.
adoptopenjdk_repo_el_enabled yes Whether the AdoptOpenJDK repository is enabled on EL-based systems.
adoptopenjdk_repo_el_filename "{{ adoptopenjdk_app_name }}" The name of the file where the repository information is stored on EL systems.
adoptopenjdk_repo_el_desired_state present Indicates the desired state of the EL repository file for AdoptOpenJDK.

Dependencies

None.

Example Playbook

For the default behavior (installation of adoptopenjdk-11-hotspot package):

- hosts: servers
  roles:
    - darkwizard242.adoptopenjdk

To customize the role (for example, to install adoptopenjdk-15-openj9 instead of adoptopenjdk-11-hotspot):

- hosts: servers
  roles:
    - darkwizard242.adoptopenjdk
  vars:
    adoptopenjdk_app_name: adoptopenjdk-15-openj9

To uninstall the adoptopenjdk-11-hotspot package:

- hosts: servers
  roles:
    - darkwizard242.adoptopenjdk
  vars:
    adoptopenjdk_desired_state: absent

License

MIT

Author Information

This role was created by Ali Muhammad.

Informazioni sul progetto

AdoptOpenJDK installation on Debian-based and EL-based systems.

Installa
ansible-galaxy install darkwizard242.adoptopenjdk
Licenza
mit
Download
19.2k
Proprietario
Senior DevOps/CloudOps Engineer. Dedicated to Automating everything I come across. Love to work on and learn new technologies/tools everyday!