fix: manage git user
- prevent different gid/uid for git users when deploying cluster - only add sudo conf when sudo_rules is a list
This commit is contained in:
parent
359ce101f1
commit
61e2d804ec
@ -2,6 +2,7 @@
|
|||||||
hiera_include:
|
hiera_include:
|
||||||
- profiles::sql::postgresdb
|
- profiles::sql::postgresdb
|
||||||
- profiles::nginx::simpleproxy
|
- profiles::nginx::simpleproxy
|
||||||
|
- profiles::gitea::user
|
||||||
- gitea
|
- gitea
|
||||||
|
|
||||||
# additional altnames
|
# additional altnames
|
||||||
@ -36,6 +37,9 @@ profiles::consul::client::node_rules:
|
|||||||
segment: git
|
segment: git
|
||||||
disposition: write
|
disposition: write
|
||||||
|
|
||||||
|
# manage the gitea user
|
||||||
|
profiles::gitea::user::manage: true
|
||||||
|
|
||||||
# manage a simple nginx reverse proxy
|
# manage a simple nginx reverse proxy
|
||||||
profiles::nginx::simpleproxy::nginx_vhost: 'git.query.consul'
|
profiles::nginx::simpleproxy::nginx_vhost: 'git.query.consul'
|
||||||
profiles::nginx::simpleproxy::nginx_aliases:
|
profiles::nginx::simpleproxy::nginx_aliases:
|
||||||
@ -55,6 +59,9 @@ profiles::sql::postgresdb::dbuser: gitea
|
|||||||
|
|
||||||
gitea::ensure: '1.22.4'
|
gitea::ensure: '1.22.4'
|
||||||
gitea::checksum: 'd549104f55067e6fb156e7ba060c9af488f36e12d5e747db7563fcc99eaf8532'
|
gitea::checksum: 'd549104f55067e6fb156e7ba060c9af488f36e12d5e747db7563fcc99eaf8532'
|
||||||
|
gitea::manage_user: false
|
||||||
|
gitea::manage_group: false
|
||||||
|
gitea::manage_home: false
|
||||||
gitea::custom_configuration:
|
gitea::custom_configuration:
|
||||||
'':
|
'':
|
||||||
APP_NAME: 'Gitea'
|
APP_NAME: 'Gitea'
|
||||||
|
|||||||
@ -12,8 +12,8 @@ define profiles::base::account (
|
|||||||
Boolean $ignore_pass = false,
|
Boolean $ignore_pass = false,
|
||||||
Array[String] $groups = [],
|
Array[String] $groups = [],
|
||||||
Array[String] $sshkeys = [],
|
Array[String] $sshkeys = [],
|
||||||
Array[String] $sudo_rules = [],
|
|
||||||
String $shell = '/usr/bin/bash',
|
String $shell = '/usr/bin/bash',
|
||||||
|
Optional[Array[String]] $sudo_rules = undef,
|
||||||
) {
|
) {
|
||||||
|
|
||||||
# Set gid to uid if gid is undef
|
# Set gid to uid if gid is undef
|
||||||
@ -39,7 +39,9 @@ define profiles::base::account (
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Manage sudo rules
|
# Manage sudo rules
|
||||||
|
if $sudo_rules {
|
||||||
sudo::conf { "${username}_sudo":
|
sudo::conf { "${username}_sudo":
|
||||||
content => $sudo_rules,
|
content => $sudo_rules,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|||||||
19
site/profiles/manifests/gitea/user.pp
Normal file
19
site/profiles/manifests/gitea/user.pp
Normal 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'],
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user