adjusted to boolean usage
This commit is contained in:
parent
9e55abd8b9
commit
d7edb606bc
1 changed files with 27 additions and 31 deletions
|
@ -25,14 +25,14 @@ define user::managed(
|
||||||
$uid = 'absent',
|
$uid = 'absent',
|
||||||
$gid = 'uid',
|
$gid = 'uid',
|
||||||
$groups = [],
|
$groups = [],
|
||||||
$manage_group = 'true',
|
$manage_group = true,
|
||||||
$membership = 'minimum',
|
$membership = 'minimum',
|
||||||
$homedir = 'absent',
|
$homedir = 'absent',
|
||||||
$managehome = 'true',
|
$managehome = true,
|
||||||
$homedir_mode = '0750',
|
$homedir_mode = '0750',
|
||||||
$sshkey = 'absent',
|
$sshkey = 'absent',
|
||||||
$password = 'absent',
|
$password = 'absent',
|
||||||
$password_crypted = 'true',
|
$password_crypted = true,
|
||||||
$shell = 'absent'
|
$shell = 'absent'
|
||||||
){
|
){
|
||||||
|
|
||||||
|
@ -66,8 +66,7 @@ define user::managed(
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
case $managehome {
|
if $managehome {
|
||||||
'true': {
|
|
||||||
file{"$real_homedir":
|
file{"$real_homedir":
|
||||||
ensure => directory,
|
ensure => directory,
|
||||||
require => User[$name],
|
require => User[$name],
|
||||||
|
@ -86,7 +85,6 @@ define user::managed(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
case $uid {
|
case $uid {
|
||||||
'absent': { info("Not defining a uid for user $name") }
|
'absent': { info("Not defining a uid for user $name") }
|
||||||
|
@ -124,8 +122,7 @@ define user::managed(
|
||||||
case $name {
|
case $name {
|
||||||
root: {}
|
root: {}
|
||||||
default: {
|
default: {
|
||||||
case $manage_group {
|
if $manage_group {
|
||||||
'true': {
|
|
||||||
group { $name:
|
group { $name:
|
||||||
allowdupe => false,
|
allowdupe => false,
|
||||||
ensure => present,
|
ensure => present,
|
||||||
|
@ -138,7 +135,6 @@ define user::managed(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
case $sshkey {
|
case $sshkey {
|
||||||
'absent': { info("no sshkey to manage for user $name") }
|
'absent': { info("no sshkey to manage for user $name") }
|
||||||
|
@ -186,12 +182,12 @@ define user::managed(
|
||||||
|
|
||||||
# gid: by default it will take the same as the uid
|
# gid: by default it will take the same as the uid
|
||||||
define user::sftp_only(
|
define user::sftp_only(
|
||||||
$managehome = 'false',
|
$managehome = false,
|
||||||
$uid = 'absent',
|
$uid = 'absent',
|
||||||
$gid = 'uid',
|
$gid = 'uid',
|
||||||
$homedir_mode = '0750',
|
$homedir_mode = '0750',
|
||||||
$password = 'absent',
|
$password = 'absent',
|
||||||
$password_crypted = 'true'
|
$password_crypted = true,
|
||||||
) {
|
) {
|
||||||
include user::groups::sftponly
|
include user::groups::sftponly
|
||||||
user::managed{"${name}":
|
user::managed{"${name}":
|
||||||
|
|
Loading…
Reference in a new issue