@@ -120,9 +132,9 @@ diff -ruN --strip-trailing-cr ServerAdmin.orig/default_maplist.html ServerAdmin/
});
//]]>
-diff -ruN --strip-trailing-cr ServerAdmin.orig/gamesummary.inc ServerAdmin/gamesummary.inc
---- ServerAdmin.orig/gamesummary.inc 2019-02-02 15:01:14.471571880 +0100
-+++ ServerAdmin/gamesummary.inc 2019-02-02 15:01:32.972537118 +0100
+diff -ruN ServerAdmin.orig/gamesummary.inc ServerAdmin/gamesummary.inc
+--- ServerAdmin.orig/gamesummary.inc 2022-12-22 01:43:19.509416046 +0100
++++ ServerAdmin/gamesummary.inc 2022-12-22 01:43:52.990541726 +0100
@@ -4,6 +4,8 @@
<%map.title.safe%>
Players
@@ -135,9 +147,9 @@ diff -ruN --strip-trailing-cr ServerAdmin.orig/gamesummary.inc ServerAdmin/games
+
<%wave.monsters.dead%>/<%wave.monsters.total%>
\ No newline at end of file
-diff -ruN --strip-trailing-cr ServerAdmin.orig/policy_bans.html ServerAdmin/policy_bans.html
---- ServerAdmin.orig/policy_bans.html 2019-02-02 15:01:14.486571852 +0100
-+++ ServerAdmin/policy_bans.html 2019-02-02 15:01:32.972537118 +0100
+diff -ruN ServerAdmin.orig/policy_bans.html ServerAdmin/policy_bans.html
+--- ServerAdmin.orig/policy_bans.html 2022-12-22 01:43:19.509416046 +0100
++++ ServerAdmin/policy_bans.html 2022-12-22 01:43:52.990541726 +0100
@@ -2,6 +2,8 @@
@@ -174,9 +186,9 @@ diff -ruN --strip-trailing-cr ServerAdmin.orig/policy_bans.html ServerAdmin/poli
-diff -ruN --strip-trailing-cr ServerAdmin.orig/policy_bans_row.inc ServerAdmin/policy_bans_row.inc
---- ServerAdmin.orig/policy_bans_row.inc 2019-02-02 15:01:14.484571856 +0100
-+++ ServerAdmin/policy_bans_row.inc 2019-02-02 15:01:32.972537118 +0100
+diff -ruN ServerAdmin.orig/policy_bans_row.inc ServerAdmin/policy_bans_row.inc
+--- ServerAdmin.orig/policy_bans_row.inc 2022-12-22 01:43:19.509416046 +0100
++++ ServerAdmin/policy_bans_row.inc 2022-12-22 01:43:52.990541726 +0100
@@ -1,15 +1,15 @@
diff --git a/roles/install/tasks/systemd.yml b/roles/install/tasks/systemd.yml
index b27d6be..9cdc49e 100644
--- a/roles/install/tasks/systemd.yml
+++ b/roles/install/tasks/systemd.yml
@@ -5,16 +5,16 @@
state: latest
- name: Install KF2 services
- copy:
- src: "{{ item }}"
- dest: "/etc/systemd/system/{{ item }}"
+ template:
+ src: "{{ item }}.service.j2"
+ dest: "/etc/systemd/system/{{ item }}.service"
owner: root
group: root
mode: '0644'
loop:
- - kf2.service
- - kf2autokick.service
- - kf2watchdog.service
+ - kf2
+ - kf2autokick
+ - kf2watchdog
notify: Reload systemd configuration
- name: Prepare systemd folder
diff --git a/roles/install/files/kf2.service b/roles/install/templates/kf2.service.j2
similarity index 98%
rename from roles/install/files/kf2.service
rename to roles/install/templates/kf2.service.j2
index 8006618..f44bd93 100644
--- a/roles/install/files/kf2.service
+++ b/roles/install/templates/kf2.service.j2
@@ -16,10 +16,12 @@ StandardOutput=file:/home/steam/Steam/logs/kf2.txt
# nevermind, the + preffix runs the command with full privileges
# prefer truncate, that way klf log keeps working even after a service restart
ExecStartPre=+/usr/bin/truncate --size=0 /home/steam/Steam/logs/kf2.txt
+{% if not kf2_classic %}
# make sure our patches work, wildcards are prohibited so use subshell
ExecStartPre=/bin/sh -c '/bin/dos2unix /home/steam/Steam/KF2Server/KFGame/Web/ServerAdmin/*'
# apply the patch, ignore if already applied
ExecStartPre=-/bin/patch --forward -r /tmp/kf2-patch.rej -p1 -d /home/steam/Steam/KF2Server/KFGame/Web/ServerAdmin -i /etc/systemd/system/kf2.service.d/serveradmin.patch
+{% endif %}
# make sure KF2 uses the Steam provided library, not the ones it bundles
ExecStartPre=/bin/ln -sTf /home/steam/Steam/linux64/steamclient.so /home/steam/Steam/KF2Server/Binaries/Win64/lib64/steamclient.so
# these appear to be gone, thankfully
diff --git a/roles/install/files/kf2autokick.service b/roles/install/templates/kf2autokick.service.j2
similarity index 100%
rename from roles/install/files/kf2autokick.service
rename to roles/install/templates/kf2autokick.service.j2
diff --git a/roles/install/files/kf2watchdog.service b/roles/install/templates/kf2watchdog.service.j2
similarity index 100%
rename from roles/install/files/kf2watchdog.service
rename to roles/install/templates/kf2watchdog.service.j2