Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

keycloak_quarkus: set openjdk 17 as default #103

Merged
merged 2 commits into from
Jul 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ jobs:
strategy:
matrix:
python_version: ["3.11"]
molecule_test:
- default
- quarkus
- overridexml
steps:
- name: Check out code
uses: actions/checkout@v2
Expand Down Expand Up @@ -67,7 +71,7 @@ jobs:
working-directory: ./ansible_collections/middleware_automation/keycloak

- name: Run molecule test
run: molecule test --all
run: molecule test -s ${{ matrix.molecule_test }}
working-directory: ./ansible_collections/middleware_automation/keycloak
env:
PY_COLORS: '1'
Expand Down
2 changes: 1 addition & 1 deletion molecule/default/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
- name: Verify we are running on requested jvm # noqa blocked_modules command-instead-of-module
ansible.builtin.shell: |
set -o pipefail
ps -ef | grep /usr/lib/jvm/java-11 | grep -v grep
ps -ef | grep '/etc/alternatives/jre_11/' | grep -v grep
args:
executable: /bin/bash
changed_when: no
Expand Down
13 changes: 4 additions & 9 deletions roles/keycloak/tasks/systemd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,9 @@
notify:
- restart keycloak

- name: Determine JAVA_HOME for selected JVM RPM # noqa blocked_modules
ansible.builtin.shell: |
set -o pipefail
rpm -ql {{ keycloak_jvm_package }} | grep -Po '/usr/lib/jvm/.*(?=/bin/java$)'
args:
executable: /bin/bash
changed_when: False
register: rpm_java_home
- name: Determine JAVA_HOME for selected JVM RPM
ansible.builtin.set_fact:
rpm_java_home: "/etc/alternatives/jre_{{ keycloak_jvm_package | regex_search('(?<=java-)[0-9.]+') }}"

- name: "Configure sysconfig file for {{ keycloak.service_name }} service"
become: yes
Expand All @@ -28,7 +23,7 @@
group: root
mode: 0644
vars:
keycloak_rpm_java_home: "{{ rpm_java_home.stdout }}"
keycloak_rpm_java_home: "{{ rpm_java_home }}"
notify:
- restart keycloak

Expand All @@ -44,7 +39,7 @@
notify:
- restart keycloak

- name: Reload systemd

Check warning on line 42 in roles/keycloak/tasks/systemd.yml

View workflow job for this annotation

GitHub Actions / ci (3.11, default)

no-handler

Tasks that run when changed should likely be handlers.

Check warning on line 42 in roles/keycloak/tasks/systemd.yml

View workflow job for this annotation

GitHub Actions / ci (3.11, quarkus)

no-handler

Tasks that run when changed should likely be handlers.

Check warning on line 42 in roles/keycloak/tasks/systemd.yml

View workflow job for this annotation

GitHub Actions / ci (3.11, overridexml)

no-handler

Tasks that run when changed should likely be handlers.
become: yes
ansible.builtin.systemd:
daemon_reload: yes
Expand Down
2 changes: 1 addition & 1 deletion roles/keycloak_quarkus/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ keycloak_quarkus_installdir: "{{ keycloak_quarkus_dest }}/keycloak-{{ keycloak_q
keycloak_quarkus_offline_install: False

### Install location and service settings
keycloak_quarkus_jvm_package: java-11-openjdk-headless
keycloak_quarkus_jvm_package: java-17-openjdk-headless
keycloak_quarkus_java_home:
keycloak_quarkus_dest: /opt/keycloak
keycloak_quarkus_home: "{{ keycloak_quarkus_installdir }}"
Expand Down
13 changes: 4 additions & 9 deletions roles/keycloak_quarkus/tasks/systemd.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
---
- name: Determine JAVA_HOME for selected JVM RPM # noqa blocked_modules
ansible.builtin.shell: |
set -o pipefail
rpm -ql {{ keycloak_quarkus_jvm_package }} | grep -Po '/usr/lib/jvm/.*(?=/bin/java$)'
args:
executable: /bin/bash
changed_when: False
register: rpm_java_home
- name: Determine JAVA_HOME for selected JVM RPM
ansible.builtin.set_fact:
rpm_java_home: "/etc/alternatives/jre_{{ keycloak_quarkus_jvm_package | regex_search('(?<=java-)[0-9.]+') }}"

- name: "Configure sysconfig file for keycloak service"
become: yes
Expand All @@ -17,7 +12,7 @@
group: root
mode: 0644
vars:
keycloak_rpm_java_home: "{{ rpm_java_home.stdout }}"
keycloak_rpm_java_home: "{{ rpm_java_home }}"
notify:
- restart keycloak

Expand All @@ -33,7 +28,7 @@
notify:
- restart keycloak

- name: Reload systemd

Check warning on line 31 in roles/keycloak_quarkus/tasks/systemd.yml

View workflow job for this annotation

GitHub Actions / ci (3.11, default)

no-handler

Tasks that run when changed should likely be handlers.

Check warning on line 31 in roles/keycloak_quarkus/tasks/systemd.yml

View workflow job for this annotation

GitHub Actions / ci (3.11, quarkus)

no-handler

Tasks that run when changed should likely be handlers.

Check warning on line 31 in roles/keycloak_quarkus/tasks/systemd.yml

View workflow job for this annotation

GitHub Actions / ci (3.11, overridexml)

no-handler

Tasks that run when changed should likely be handlers.
become: yes
ansible.builtin.systemd:
daemon_reload: yes
Expand Down
Loading