fix: manage git user (#339)

- prevent different gid/uid for git users when deploying cluster
- only add sudo conf when sudo_rules is a list

Reviewed-on: https://git.query.consul/unkinben/puppet-prod/pulls/339
This commit was merged in pull request #339.
This commit is contained in:
2025-07-06 11:27:35 +10:00
parent 359ce101f1
commit cf0ff85b70
3 changed files with 31 additions and 3 deletions
+5 -3
View File
@@ -12,8 +12,8 @@ define profiles::base::account (
Boolean $ignore_pass = false,
Array[String] $groups = [],
Array[String] $sshkeys = [],
Array[String] $sudo_rules = [],
String $shell = '/usr/bin/bash',
Optional[Array[String]] $sudo_rules = undef,
) {
# Set gid to uid if gid is undef
@@ -39,7 +39,9 @@ define profiles::base::account (
}
# Manage sudo rules
sudo::conf { "${username}_sudo":
content => $sudo_rules,
if $sudo_rules {
sudo::conf { "${username}_sudo":
content => $sudo_rules,
}
}
}
+19
View File
@@ -0,0 +1,19 @@
# creates gitea service user
class profiles::gitea::user (
Boolean $manage = false,
String $user = 'git',
String $group = 'git',
Integer $uid = 1101,
Integer $gid = 1101,
) {
if $manage {
profiles::base::account {'git':
username => 'git',
uid => $uid,
gid => $gid,
system => false,
before => Class['gitea'],
}
}
}