Skip to content

Commit

Permalink
Updating builders java openjdk to version 17 on both rhel and debian
Browse files Browse the repository at this point in the history
distros

Signed-off-by: Adam Kraitman <[email protected]>
  • Loading branch information
akraitman committed Nov 13, 2024
1 parent 401f5aa commit ec4773a
Showing 1 changed file with 26 additions and 2 deletions.
28 changes: 26 additions & 2 deletions ansible/examples/builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
- osc_pass: 'password'
- container_mirror: 'docker-mirror.front.sepia.ceph.com:5000'
- secrets_path: "{{ lookup('env', 'ANSIBLE_SECRETS_PATH') | default('/etc/ansible/secrets', true) }}"
- java_version: 'java-17'


tasks:
Expand Down Expand Up @@ -56,6 +57,7 @@
- libffi-dev
- default-jdk
- default-jre
- openjdk-17-jdk
- debian-keyring
- debian-archive-keyring
- software-properties-common
Expand Down Expand Up @@ -144,7 +146,7 @@
- set_fact:
universal_rpms:
- createrepo
- java-11-openjdk
- java-17-openjdk
- git
- libtool
#- rpm-sign
Expand Down Expand Up @@ -831,6 +833,27 @@
- libvirt-guests
when: libvirt|bool

- name: Set java alternatives for debian
block:
- name: Get java version alternantive
shell: >-
update-alternatives --query java | awk -F':' '/{{ java_version }}/ && /Alternative/ {print $2}'
register: java_alternatives
changed_when: false

- name: Set java version alternantive
alternatives:
name: java
path: "{{ java_alternatives.stdout.strip() }}"
when:
- (ansible_os_family | lower) == 'debian'

- name: Set java version alternantive for RedHat
shell:
cmd: update-alternatives --set java '{{ java_version }}-openjdk.{{ ansible_architecture }}'
when:
- (ansible_os_family | lower) == 'redhat'

## CONTAINER SERVICE TASKS
- name: Container Tasks
block:
Expand Down Expand Up @@ -935,9 +958,10 @@
register: jar_changed

- name: Install the systemd unit files for jenkins
template:
ansible.builtin.template:
src: "templates/systemd/jenkins.{{ item }}.j2"
dest: "/etc/systemd/system/jenkins.{{ item }}"
force: yes
with_items:
- service
- secret
Expand Down

0 comments on commit ec4773a

Please sign in to comment.