# # Systemd unit file that manages Keycloak # [Unit] Description=Keycloak Application Server, running with Quarkus After=syslog.target network.target {% if keycloak_before_nginx %} Before=nginx.service {% endif %} {% if keycloak_before_apache_httpd %} {% if ansible_distribution_file_variety == "RedHat" %} Before=httpd.service {% endif %} {% if ansible_distribution_file_variety == "Debian" %} Before=apache2.service {% endif %} {% endif %} StartLimitIntervalSec=500 StartLimitBurst=5 [Service] Environment=JAVA={{ keycloak_openjdk_bin }} Environment=JAVA_HOME=/usr/lib/jvm/java-{{ keycloak_openjdk_runtime_version}}-openjdk-amd64 Environment=JAVA_OPTS="{{ keycloak_java_opts }}" {% if not keycloak_jgroups_extended_stack %} Environment=JAVA_OPTS_APPEND="-Djgroups.bind_addr={{ keycloak_jgroups_multicast_bind_host | default(ansible_default_ipv4.address) }} -Djgroups.mcast_addr={{ keycloak_jgroups_multicast_address}} -Djgroups.mcast_port={{ keycloak_jgroups_multicast_port }}" {% endif %} User={{ keycloak_user }} Group={{ keycloak_user }} ExecStart={{ keycloak_runtime_home }}/bin/kc.sh start SuccessExitStatus=0 143 UMask=0027 RestartSec=10 Restart=on-failure [Install] WantedBy=multi-user.target