update systemd unit to use standalone.sh directly

This commit is contained in:
Guido Grazioli 2023-08-30 10:58:37 +02:00
parent 0199e554b5
commit 7bb9647d0d
2 changed files with 11 additions and 4 deletions

View file

@ -8,4 +8,12 @@ KEYCLOAK_HTTPS_PORT={{ keycloak_https_port }}
KEYCLOAK_MANAGEMENT_HTTP_PORT={{ keycloak_management_http_port }} KEYCLOAK_MANAGEMENT_HTTP_PORT={{ keycloak_management_http_port }}
KEYCLOAK_MANAGEMENT_HTTPS_PORT={{ keycloak_management_https_port }} KEYCLOAK_MANAGEMENT_HTTPS_PORT={{ keycloak_management_https_port }}
JBOSS_PIDFILE='{{ keycloak_service_pidfile }}' JBOSS_PIDFILE='{{ keycloak_service_pidfile }}'
LAUNCH_JBOSS_IN_BACKGROUND=1
WILDFLY_OPTS=-Djboss.bind.address=${KEYCLOAK_BIND_ADDRESS} \
-Djboss.http.port=${KEYCLOAK_HTTP_PORT} \
-Djboss.https.port=${KEYCLOAK_HTTPS_PORT} \
-Djboss.management.http.port=${KEYCLOAK_MANAGEMENT_HTTP_PORT} \
-Djboss.management.https.port=${KEYCLOAK_MANAGEMENT_HTTPS_PORT} \
-Djboss.node.name={{ inventory_hostname }} \
{% if keycloak_prefer_ipv4 %}-Djava.net.preferIPv4Stack=true -Djava.net.preferIPv4Addresses=true {% endif %}\
{% if keycloak_config_standalone_xml is defined %}--server-config={{ keycloak_config_standalone_xml }}{% endif %}

View file

@ -7,15 +7,14 @@ StartLimitBurst={{ keycloak_service_startlimitburst }}
[Service] [Service]
Type=forking
{% if keycloak_service_runas %} {% if keycloak_service_runas %}
User={{ keycloak_service_user }} User={{ keycloak_service_user }}
Group={{ keycloak_service_group }} Group={{ keycloak_service_group }}
{% endif -%} {% endif -%}
EnvironmentFile=-/etc/sysconfig/keycloak EnvironmentFile=-/etc/sysconfig/keycloak
PIDFile={{ keycloak_service_pidfile }} PIDFile={{ keycloak_service_pidfile }}
ExecStart={{ keycloak_dest }}/keycloak-service.sh start ExecStart={{ keycloak.home }}/bin/standalone.sh $WILDFLY_OPTS
ExecStop={{ keycloak_dest }}/keycloak-service.sh stop WorkingDirectory={{ keycloak.home }}
TimeoutStartSec=30 TimeoutStartSec=30
TimeoutStopSec=30 TimeoutStopSec=30
LimitNOFILE=102642 LimitNOFILE=102642