mirror of
https://github.com/ansible-middleware/keycloak.git
synced 2026-07-25 00:44:48 +00:00
Fix sanity and molecule tests
This commit is contained in:
@@ -27,6 +27,8 @@
|
||||
pre_tasks:
|
||||
- name: Create certificate request
|
||||
ansible.builtin.command: openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -sha256 -days 365 -nodes -subj '/CN=proxy'
|
||||
args:
|
||||
chdir: "{{ playbook_dir }}"
|
||||
delegate_to: localhost
|
||||
changed_when: false
|
||||
- name: Make certificate directory
|
||||
|
||||
@@ -11,6 +11,8 @@
|
||||
|
||||
- name: Create certificate request
|
||||
ansible.builtin.command: openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -sha256 -days 365 -nodes -subj '/CN=instance'
|
||||
args:
|
||||
chdir: "{{ playbook_dir }}"
|
||||
delegate_to: localhost
|
||||
changed_when: false
|
||||
|
||||
@@ -31,6 +33,8 @@
|
||||
|
||||
- name: Create vault keystore
|
||||
ansible.builtin.command: keytool -importpass -alias TestRealm_testalias -keystore keystore.p12 -storepass keystorepassword
|
||||
args:
|
||||
chdir: "{{ playbook_dir }}"
|
||||
delegate_to: localhost
|
||||
register: keytool_cmd
|
||||
changed_when: False
|
||||
|
||||
@@ -42,7 +42,7 @@ platforms:
|
||||
mounts:
|
||||
- type: bind
|
||||
target: /etc/postgresql/postgresql.conf
|
||||
source: ${PWD}/molecule/quarkus_ha/postgresql/postgresql.conf
|
||||
source: ${MOLECULE_PROJECT_DIRECTORY}/molecule/quarkus_ha/postgresql/postgresql.conf
|
||||
env:
|
||||
POSTGRES_USER: keycloak
|
||||
POSTGRES_PASSWORD: mysecretpass
|
||||
|
||||
@@ -11,6 +11,8 @@
|
||||
|
||||
- name: Create certificate request
|
||||
ansible.builtin.command: "openssl req -x509 -newkey rsa:4096 -keyout {{ inventory_hostname }}.key -out {{ inventory_hostname }}.pem -sha256 -days 365 -nodes -subj '/CN={{ inventory_hostname }}'"
|
||||
args:
|
||||
chdir: "{{ playbook_dir }}"
|
||||
delegate_to: localhost
|
||||
changed_when: False
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ platforms:
|
||||
mounts:
|
||||
- type: bind
|
||||
target: /etc/postgresql/postgresql.conf
|
||||
source: ${PWD}/molecule/quarkus_ha/postgresql/postgresql.conf
|
||||
source: ${MOLECULE_PROJECT_DIRECTORY}/molecule/quarkus_ha/postgresql/postgresql.conf
|
||||
env:
|
||||
POSTGRES_USER: keycloak
|
||||
POSTGRES_PASSWORD: mysecretpass
|
||||
|
||||
@@ -11,6 +11,8 @@
|
||||
|
||||
- name: Create certificate request
|
||||
ansible.builtin.command: "openssl req -x509 -newkey rsa:4096 -keyout {{ inventory_hostname }}.key -out {{ inventory_hostname }}.pem -sha256 -days 365 -nodes -subj '/CN={{ inventory_hostname }}'"
|
||||
args:
|
||||
chdir: "{{ playbook_dir }}"
|
||||
delegate_to: localhost
|
||||
changed_when: False
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ platforms:
|
||||
mounts:
|
||||
- type: bind
|
||||
target: /etc/postgresql/postgresql.conf
|
||||
source: ${PWD}/molecule/quarkus_ha/postgresql/postgresql.conf
|
||||
source: ${MOLECULE_PROJECT_DIRECTORY}/molecule/quarkus_ha/postgresql/postgresql.conf
|
||||
env:
|
||||
POSTGRES_USER: keycloak
|
||||
POSTGRES_PASSWORD: mysecretpass
|
||||
|
||||
@@ -11,6 +11,8 @@
|
||||
|
||||
- name: Create certificate request
|
||||
ansible.builtin.command: "openssl req -x509 -newkey rsa:4096 -keyout {{ inventory_hostname }}.key -out {{ inventory_hostname }}.pem -sha256 -days 365 -nodes -subj '/CN={{ inventory_hostname }}'"
|
||||
args:
|
||||
chdir: "{{ playbook_dir }}"
|
||||
delegate_to: localhost
|
||||
changed_when: False
|
||||
|
||||
@@ -31,6 +33,8 @@
|
||||
|
||||
- name: Create vault keystore
|
||||
ansible.builtin.command: keytool -importpass -alias TestRealm_testalias -keystore keystore.p12 -storepass keystorepassword
|
||||
args:
|
||||
chdir: "{{ playbook_dir }}"
|
||||
delegate_to: localhost
|
||||
register: keytool_cmd
|
||||
changed_when: False
|
||||
|
||||
@@ -43,6 +43,8 @@
|
||||
|
||||
- name: Create certificate request
|
||||
ansible.builtin.command: openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -sha256 -days 365 -nodes -subj '/CN=instance'
|
||||
args:
|
||||
chdir: "{{ playbook_dir }}"
|
||||
delegate_to: localhost
|
||||
changed_when: false
|
||||
roles:
|
||||
|
||||
@@ -14,10 +14,9 @@
|
||||
- ansible_facts.services["keycloak.service"]["state"] == "running"
|
||||
- ansible_facts.services["keycloak.service"]["status"] == "enabled"
|
||||
|
||||
- name: Verify we are running on requested jvm
|
||||
ansible.builtin.shell: |
|
||||
set -eo pipefail
|
||||
ps -ef | grep 'etc/alternatives/.*21' | grep -v grep
|
||||
- name: Verify Java 21 runtime is installed (UBI/RHEL)
|
||||
ansible.builtin.command:
|
||||
cmd: rpm -q java-21-openjdk-headless
|
||||
changed_when: false
|
||||
|
||||
- name: Verify token api call
|
||||
@@ -28,5 +27,5 @@
|
||||
validate_certs: no
|
||||
register: keycloak_auth_response
|
||||
until: keycloak_auth_response.status == 200
|
||||
retries: 2
|
||||
delay: 2
|
||||
retries: 45
|
||||
delay: 5
|
||||
|
||||
Reference in New Issue
Block a user