diff --git a/roles/keycloak/tasks/systemd.yml b/roles/keycloak/tasks/systemd.yml index 67fd2e1..c189a70 100644 --- a/roles/keycloak/tasks/systemd.yml +++ b/roles/keycloak/tasks/systemd.yml @@ -38,12 +38,23 @@ daemon_reload: yes when: systemdunit.changed -- name: start keycloak - systemd: - name: keycloak - enabled: yes - state: started - become: yes +- block: + - name: start keycloak + systemd: + name: keycloak + enabled: yes + state: started + become: yes + rescue: + - command: "systemctl status keycloak" + changed_when: False + ignore_errors: True + - command: "journalctl -xe -ukeycloak" + changed_when: False + ignore_errors: True + - command: "tail -n 100 /opt/keycloak/keycloak.log" + changed_when: False + ignore_errors: True - command: "systemctl status keycloak" register: keycloak_service_status