---
galaxy_info:
+ namespace: lfit
+ role_name: java_install
author: Linux Foundation Release Engineering
description: Install Java for use in LF Jenkins infra.
company: The Linux Foundation
- name: EL
versions:
- 7
+ - 8
+
- name: Ubuntu
versions:
- xenial
+ - bionic
+ - focal
galaxy_tags:
- java
when: ansible_os_family == "RedHat" and ansible_distribution_major_version == "8"
become: true
+- name: Install OpenJDK 21, latest
+ yum:
+ name:
+ - java-21-openjdk-devel
+ - java-latest-openjdk-devel
+ state: present
+ when: ansible_os_family == "RedHat" and ansible_distribution_major_version == "9"
+ become: true
+
- name: Set Java path for OpenJDK 11
set_fact:
java_path: /usr/lib/jvm/java-11-openjdk
passenv = *
commands =
./molecule.sh
+allowlist_externals =
+ ./molecule.sh
[testenv:pre-commit]
basepython = python3
deps = pre-commit
+allowlist_externals = /bin/sh
commands =
pre-commit run --all-files --show-diff-on-failure
- pre-commit run gitlint --hook-stage commit-msg --commit-msg-filename .git/COMMIT_EDITMSG
+ /bin/sh -c 'if ! git config --get user.name > /dev/null; then \
+ git config --global --add user.name "CI"; \
+ touch .git/REMOVE_USERNAME; fi'
+ /bin/sh -c 'if ! git config --get user.email > /dev/null; then \
+ git config --global --add user.email "ci@example.org"; \
+ touch .git/REMOVE_USEREMAIL; fi'
+ /bin/sh -c "if [ -f .git/COMMIT_EDITMSG ]; then \
+ cp .git/COMMIT_EDITMSG .git/COMMIT_MSGTOX; else \
+ git log HEAD -n1 | tail -n +5 | cut -c 5- > .git/COMMIT_MSGTOX; fi"
+ pre-commit run gitlint --hook-stage commit-msg --commit-msg-filename .git/COMMIT_MSGTOX
+ /bin/sh -c "rm -f .git/COMMIT_MSGTOX"
+ /bin/sh -c "if [ -f .git/REMOVE_USERNAME ]; then \
+ git config --global --unset user.name; \
+ rm -f .git/REMOVE_USERNAME; fi"
+ /bin/sh -c "if [ -f .git/REMOVE_USEREMAIL ]; then \
+ git config --global --unset user.email; \
+ rm -f .git/REMOVE_USEREMAIL; fi"