Explorar o código

siwtch to systemd

Chris Mague %!s(int64=8) %!d(string=hai) anos
pai
achega
5095a9f73d
Modificáronse 2 ficheiros con 28 adicións e 2 borrados
  1. 14 0
      files/keycloak_systemd
  2. 14 2
      tasks/main.yml

+ 14 - 0
files/keycloak_systemd

@@ -0,0 +1,14 @@
+#####################################################################
+[Unit]
+Description=Keycloak Server
+After=network.target
+
+[Service]
+Type=simple
+LimitNOFILE=65535
+WorkingDirectory=/opt/keycloak
+ExecStart=/opt/keycloak/bin/standalone.sh  -b 0.0.0.0 --server-config=standalone.xml
+
+[Install]
+WantedBy=multi-user.target
+Alias=keycloak.service

+ 14 - 2
tasks/main.yml

@@ -39,5 +39,17 @@
     src: "standalone.xml.j2"
     src: "standalone.xml.j2"
     dest: /opt/keycloak/standalone/configuration
     dest: /opt/keycloak/standalone/configuration
 
 
-- name: Start keycloak process
-  runit: name=keycloak enabled=yes state=start timeout=90 command='/opt/keycloak/bin/standalone.sh  -b 0.0.0.0 --server-config=standalone.xml'
+- name: Setup le Systemd
+  copy:
+    src: keycloak_systemd
+    dest: /lib/systemd/system/keycloak.service
+    owner: root
+    group: root
+    mode: 0644
+
+- name: run the keycloak
+  systemd:
+    name: keycloak
+    state: started
+    enabled: yes
+