From 72d1a736952a33c0fc763e09e0200e62d2f5298f Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Thu, 13 Feb 2025 12:37:33 +0100 Subject: [PATCH] MT#61101 Add Valkey support Switch the main key/value service to use the database.key_value.flavor. Add explicit support for valkey directories and user/group. Change-Id: Idd21565e66c940c564045ebd02dd148ad3562e9e --- templates/130_filesys-ngcp.yaml.tt2 | 15 +++++++++++++++ templates/200_user-debian.yaml.tt2 | 9 +++++++++ templates/400_process-debian.yaml.tt2 | 2 +- templates/510_init-daemons-ngcp.yaml.tt2 | 2 +- 4 files changed, 26 insertions(+), 2 deletions(-) diff --git a/templates/130_filesys-ngcp.yaml.tt2 b/templates/130_filesys-ngcp.yaml.tt2 index 52caf7f..f650596 100644 --- a/templates/130_filesys-ngcp.yaml.tt2 +++ b/templates/130_filesys-ngcp.yaml.tt2 @@ -284,6 +284,21 @@ file: linked-to: /ngcp-data/victoria-metrics filetype: symlink + /ngcp-data/valkey: + exists: true + mode: "0750" + owner: valkey + group: valkey + filetype: directory + + /var/lib/valkey: + exists: true + mode: "0777" + owner: root + group: root + linked-to: /ngcp-data/valkey + filetype: symlink + /ngcp-data/keydb: exists: true mode: "0750" diff --git a/templates/200_user-debian.yaml.tt2 b/templates/200_user-debian.yaml.tt2 index e372ec1..c72d25f 100644 --- a/templates/200_user-debian.yaml.tt2 +++ b/templates/200_user-debian.yaml.tt2 @@ -36,6 +36,9 @@ group: sudo: exists: true + valkey: + exists: true + www-data: exists: true @@ -103,6 +106,12 @@ user: - "/var/run/sshd" - "/run/sshd" + valkey: + exists: true + groups: + - valkey + home: "/var/lib/valkey" + www-data: exists: true groups: diff --git a/templates/400_process-debian.yaml.tt2 b/templates/400_process-debian.yaml.tt2 index 7658d3f..4409370 100644 --- a/templates/400_process-debian.yaml.tt2 +++ b/templates/400_process-debian.yaml.tt2 @@ -17,7 +17,7 @@ process: ntpd: running: [% ntp.backend == 'ntpd' ? 'true' : 'false ' %] - keydb-server: + [% database.key_value.flavor %]-server: running: true redis-server: diff --git a/templates/510_init-daemons-ngcp.yaml.tt2 b/templates/510_init-daemons-ngcp.yaml.tt2 index e3b7f16..09f7266 100644 --- a/templates/510_init-daemons-ngcp.yaml.tt2 +++ b/templates/510_init-daemons-ngcp.yaml.tt2 @@ -92,7 +92,7 @@ service: enabled: [% general.process_handler == 'none' && is_lb && pushd.enable == "yes" ? 'true' : 'false' %] running: [% is_lb && pushd.enable == "yes" ? 'true' : 'false' %] - keydb-server.service: + [% database.key_value.flavor %]-server.service: enabled: [% redis.enable == "yes" ? 'true' : 'false' %] running: [% redis.enable == "yes" ? 'true' : 'false' %]