From 2fd7a0664058a6b12589e5bced895b947d9c767f Mon Sep 17 00:00:00 2001 From: Paul Date: Fri, 6 Sep 2024 17:19:41 +0200 Subject: [PATCH] updated qrz state --- states/qrz/defaults.yaml | 8 ++++++-- states/qrz/install.sls | 25 +++++++++++++++++++++++-- states/qrz/templates/qrz.service.j2 | 2 +- 3 files changed, 30 insertions(+), 5 deletions(-) diff --git a/states/qrz/defaults.yaml b/states/qrz/defaults.yaml index 8b42d52..7542096 100644 --- a/states/qrz/defaults.yaml +++ b/states/qrz/defaults.yaml @@ -8,5 +8,9 @@ qrz: version: 1.3.4 os: linux arch: amd64 - user: qrz - group: qrz + user: + name: qrz + uid: 902 + group: + name: qrz + gid: 902 diff --git a/states/qrz/install.sls b/states/qrz/install.sls index 29d53fb..36f7beb 100644 --- a/states/qrz/install.sls +++ b/states/qrz/install.sls @@ -20,11 +20,32 @@ qrz-binary-symlink: - watch_in: - service: qrz-service +qrz-group: + group.present: + - name: {{ qrz.group.name }} + - gid: {{ qrz.group.gid }} + - watch_in: + - service: qrz-service + +qrz-user: + user.present: + - name:{{ qrz.user.name }} + - uid: {{ qrz.user.uid }} + - gid: {{ qrz.group.gid }} + - shell: /sbin/nologin + - allow_uid_change: true + - allow_gid_change: true + - home: /var/lib/qrz + - watch_in: + - service: qrz-service + qrz-directory: file.directory: - name: /var/lib/qrz - - user: {{ qrz.user }} - - group: {{ qrz.group }} + - user: {{ qrz.user.name }} + - group: {{ qrz.group.name }} + - watch_in: + - service: qrz-service qrz-cleanup: software.cleanup: diff --git a/states/qrz/templates/qrz.service.j2 b/states/qrz/templates/qrz.service.j2 index 8492ac1..bb14711 100644 --- a/states/qrz/templates/qrz.service.j2 +++ b/states/qrz/templates/qrz.service.j2 @@ -6,7 +6,7 @@ After=network.target postgresql.service [Service] Type=simple -User={{ qrz.user }} +User={{ qrz.user.name }} ExecStart={{ qrz.install_dir }}/qrz/qrz -configfile {{ qrz.install_dir }}/config/common.ini -port {{ qrz.port }} [Install]