From f79988efcadee3da7c68619de88d0d9ec74fa837 Mon Sep 17 00:00:00 2001 From: Kevin Carter Date: Mon, 26 Nov 2018 11:38:13 -0600 Subject: [PATCH] Allow user/group to be overriden in unit section The unit section allows for user/group to be set via global variable however in some cases a specific unit may need to have a different user/group setup. This change allows for the users to be defined in the service definition and falls back to the global default. Change-Id: I69540efd2c993912b042a1b6b6a1dc279542f325 Signed-off-by: Kevin Carter --- templates/systemd-service.j2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/systemd-service.j2 b/templates/systemd-service.j2 index a72ad65..9d71050 100644 --- a/templates/systemd-service.j2 +++ b/templates/systemd-service.j2 @@ -13,8 +13,8 @@ Documentation={{ item }} [Service] {% set service_type = item.service_type | default(systemd_default_service_type) %} Type={{ service_type }} -User={{ systemd_user_name }} -Group={{ systemd_group_name }} +User={{ item.systemd_user_name | default(systemd_user_name) }} +Group={{ item.systemd_group_name | default(systemd_group_name) }} {% set _execstarts = item.execstarts %} {% if _execstarts is string %}