diff --git a/tasks/main.yml b/tasks/main.yml index 1a88710..15c2b5a 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -57,6 +57,9 @@ - name: link /opt/keycloak/keycloak-21.0.1 to /opt/keycloak/current file: state: link + owner: keycloak + group: keycloak + mode: '0770' src: /opt/keycloak/keycloak-21.0.1 dest: /opt/keycloak/current @@ -143,9 +146,9 @@ state: started when: not adminuseradded_exists.stat.exists -- name: Sleep 60 seconds +- name: Sleep 120 seconds ansible.builtin.wait_for: - timeout: 60 + timeout: 120 delegate_to: localhost when: not adminuseradded_exists.stat.exists diff --git a/templates/keycloak.service.j2 b/templates/keycloak.service.j2 index 8a12893..5c4ccf4 100644 --- a/templates/keycloak.service.j2 +++ b/templates/keycloak.service.j2 @@ -11,10 +11,11 @@ TimeoutStartSec=600 TimeoutStopSec=600 Environment="KC_HTTP_HOST={{ keycloak_http_host}}" Environment="KC_HOSTNAME={{ inventory_hostname }}" +Environment="KC_DB=postgres" Environment="KC_DB_USERNAME={{ keycloak_postgresql_username }}" Environment="KC_DB_PASSWORD={{ keycloak_postgresql_password }}" Environment="KC_DB_URL_DATABASE={{ keycloak_postgresql_database }}" -Environment="KC_DB_URL_HOST={{ inventory_hostname }}" +Environment="KC_DB_URL_HOST=localhost" Environment="KC_PROXY=edge" [Install] diff --git a/templates/keycloak.service_init.j2 b/templates/keycloak.service_init.j2 index e64c3d1..7dacc51 100644 --- a/templates/keycloak.service_init.j2 +++ b/templates/keycloak.service_init.j2 @@ -11,10 +11,11 @@ TimeoutStartSec=600 TimeoutStopSec=600 Environment="KC_HTTP_HOST={{ keycloak_http_host}}" Environment="KC_HOSTNAME={{ inventory_hostname }}" +Environment="KC_DB=postgres" Environment="KC_DB_USERNAME={{ keycloak_postgresql_username }}" Environment="KC_DB_PASSWORD={{ keycloak_postgresql_password }}" Environment="KC_DB_URL_DATABASE={{ keycloak_postgresql_database }}" -Environment="KC_DB_URL_HOST={{ inventory_hostname }}" +Environment="KC_DB_URL_HOST=localhost" Environment="KC_PROXY=edge" Environment="KEYCLOAK_ADMIN={{ keycloak_initial_admin_name }}" Environment="KEYCLOAK_ADMIN_PASSWORD={{ keycloak_initial_admin_password }}"