From: Anil Belur Date: Thu, 20 Jan 2022 06:12:16 +0000 (+1000) Subject: Feat: Install OpenJDK17 X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F43%2F69543%2F10;p=ansible%2Froles%2Fjava-install.git Feat: Install OpenJDK17 - OpenJDK 17 is the next LTS release JDK requried for ODL. - Update tox, molecule and pre-commit depenencies. Issue-ID: RELENG-4097 Change-Id: Ie30c0b8dee8750ed295396c02ac1c3d8494b2595 Signed-off-by: Anil Belur --- diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c1879a6..b10b09b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,11 +1,11 @@ --- repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v1.3.0 + rev: v4.1.0 hooks: - id: trailing-whitespace - repo: https://github.com/jorisroovers/gitlint - rev: v0.11.0 + rev: v0.17.0 hooks: - id: gitlint diff --git a/molecule/default/molecule.yml b/molecule/default/molecule.yml index 572361f..2d3f443 100644 --- a/molecule/default/molecule.yml +++ b/molecule/default/molecule.yml @@ -10,8 +10,12 @@ lint: | platforms: - name: centos7 image: centos:7 - - name: ubuntu1604 - image: ubuntu:16.04 + - name: centos8 + image: centos:8 + - name: ubuntu1804 + image: ubuntu:18.04 + - name: ubuntu2004 + image: ubuntu:20.04 provisioner: name: ansible scenario: diff --git a/tasks/Debian.yml b/tasks/Debian.yml index 77d660e..aa14fc3 100644 --- a/tasks/Debian.yml +++ b/tasks/Debian.yml @@ -1,10 +1,18 @@ --- +- name: Install ppa pre-requsites + apt: + name: + - gnupg2 + state: present + update_cache: 'yes' + become: true + - name: Setup openjdk-r/ppa apt_repository: repo: 'ppa:openjdk-r/ppa' become: true -- name: Install OpenJDK 1.8.0, 1.11 and 1.12 +- name: Install OpenJDK 1.8.0, 11 and 12 apt: name: - openjdk-8-jdk @@ -14,6 +22,17 @@ update_cache: 'yes' become: true +- name: Install OpenJDK 17 + apt: + name: + - openjdk-17-jdk + state: present + update_cache: 'yes' + become: true + when: + - ansible_os_family == "Debian" + - ansible_distribution_major_version == "11" or ansible_distribution_version == "20.04" + - name: Set Java path for OpenJDK 1.8.0 set_fact: java_path: /usr/lib/jvm/java-1.8.0-openjdk-amd64 diff --git a/tasks/RedHat.yml b/tasks/RedHat.yml index 780ae57..ad100cc 100644 --- a/tasks/RedHat.yml +++ b/tasks/RedHat.yml @@ -4,15 +4,24 @@ when: ansible_os_family == "RedHat" become: true -- name: Install OpenJDK 1.8.0, 1.11 and 1.12 +- name: Install OpenJDK 1.8.0, 11 and 17 yum: name: - java-1.8.0-openjdk-devel - java-11-openjdk-devel + - java-17-openjdk-devel - java-latest-openjdk-devel state: present become: true +- name: Install OpenJDK 17 + yum: + name: + - java-17-openjdk-devel + state: present + when: ansible_os_family == "RedHat" and ansible_distribution_major_version == "8" + become: true + - name: Set Java path for OpenJDK 1.8.0 set_fact: java_path: /usr/lib/jvm/java-1.8.0-openjdk diff --git a/tox.ini b/tox.ini index 2efc906..0226738 100644 --- a/tox.ini +++ b/tox.ini @@ -12,7 +12,9 @@ deps = ansible-lint~=4.2.0 detox~=0.18 docker - molecule + yamllint + molecule~=3.0.8 + molecule[docker] pytest~=5.4.0 passenv = * commands =