diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2016-06-18 13:41:19 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2016-06-18 13:41:19 -0300 |
commit | cf6b8e9eac809bca6e558131a56ba55accb3b46c (patch) | |
tree | 0f72f0671b1229d7f1ecb2778d18ed7764354e6c /manifests/site | |
parent | d5be34ca78f3330c4eb04ab59bc236641c392b94 (diff) | |
download | puppet-apache-cf6b8e9eac809bca6e558131a56ba55accb3b46c.tar.gz puppet-apache-cf6b8e9eac809bca6e558131a56ba55accb3b46c.tar.bz2 |
Adds apache::site::user
Diffstat (limited to 'manifests/site')
-rw-r--r-- | manifests/site/user.pp | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/manifests/site/user.pp b/manifests/site/user.pp new file mode 100644 index 0000000..ec5866c --- /dev/null +++ b/manifests/site/user.pp @@ -0,0 +1,56 @@ +define apache::site::user( + $ensure = present, + $mpm = true, + $manage_user = true, + $user = $name, + $gid = $name, + $ticket = false, + $password = '*', + $comment = '', + $sshkey = absent, + $sshkey_options = [], + $groups = '', + $shell = '/bin/false', +){ + if $mpm == true and $manage_user == true and $user != 'root' { + if $ensure == present { + if !defined(Group[$gid]) { + group { "$gid": + ensure => present, + } + } + + if !defined(User["$user"]) { + user::manage { "$user": + tag => "virtual", + password => $password, + gid => $gid, + comment => $comment, + ticket => $ticket, + groups => $groups, + sshkey => $sshkey, + sshkey_options => $sshkey_options, + shell => $shell, + ensure => present, + require => Group[$gid], + } + } + } + else { + if !defined(User["$user"]) { + user::manage { "$user": + tag => "virtual", + password => $password, + ensure => absent, + } + } + + if !defined(Group[$gid]) { + group { "$gid": + ensure => absent, + require => User[$user], + } + } + } + } +} |