From 5b7bc049476c576e303b56447d38cc56d8f5133a Mon Sep 17 00:00:00 2001 From: Ben Vincent Date: Sun, 30 Mar 2025 01:16:11 +1100 Subject: [PATCH] chore: enable extra groups - enable adding extra groups to the sysadmin user --- site/profiles/manifests/accounts/sysadmin.pp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/site/profiles/manifests/accounts/sysadmin.pp b/site/profiles/manifests/accounts/sysadmin.pp index f766f31..0c9050d 100644 --- a/site/profiles/manifests/accounts/sysadmin.pp +++ b/site/profiles/manifests/accounts/sysadmin.pp @@ -2,12 +2,22 @@ class profiles::accounts::sysadmin( String $password, Array[String] $sshkeys = [], + Array[String] $extra_groups = [], ){ + + $default_groups = [ + 'adm', + 'admins', + 'systemd-journal' + ] + + $groups = $extra_groups + $default_groups + profiles::base::account {'sysadmin': username => 'sysadmin', uid => 1000, gid => 1000, - groups => ['adm', 'admins', 'systemd-journal'], + groups => $groups, sshkeys => $sshkeys, sudo_rules => ['sysadmin ALL=(ALL) NOPASSWD:ALL'], password => $password,