feat: add othergroups support for services

- extend glauth::obj::service to allow othergroups
This commit is contained in:
Ben Vincent 2024-07-11 19:59:26 +10:00
parent 3dc8fb03fa
commit 95a0b543fd
2 changed files with 7 additions and 0 deletions

View File

@ -6,7 +6,12 @@ define glauth::obj::service (
Integer $primarygroup,
String $passsha256,
Stdlib::Absolutepath $config_path,
Optional[Array[Integer]] $othergroups = [],
) {
$formatted_othergroups = $othergroups.empty ? {
true => '[]',
false => "[${othergroups.join(', ')}]",
}
concat::fragment { "glauth_service_${service_name}":
target => $config_path,
content => epp('glauth/obj/service.epp', {
@ -15,6 +20,7 @@ define glauth::obj::service (
'uidnumber' => $uidnumber,
'primarygroup' => $primarygroup,
'passsha256' => $passsha256,
'othergroups' => $formatted_othergroups,
}),
order => '80',
}

View File

@ -4,4 +4,5 @@
uidnumber = <%= $uidnumber %>
primarygroup = <%= $primarygroup %>
passsha256 = "<%= $passsha256 %>"
othergroups = <%= $othergroups %>