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:
@@ -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,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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'],
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user