diff options
author | jonoterc <jon_obuchowski@terc.edu> | 2013-10-10 17:34:49 -0400 |
---|---|---|
committer | Adam Jahn <ajjahn@gmail.com> | 2014-01-10 18:15:58 -0500 |
commit | 821bb50151990f57461b29e19027d971e5842e4a (patch) | |
tree | 5dc65c143faf67946b268a871f150d749a2fdc0e /manifests/server | |
parent | e22aac5672174c77500e32984b7a139a1d0ac931 (diff) | |
download | puppet-samba-821bb50151990f57461b29e19027d971e5842e4a.tar.gz puppet-samba-821bb50151990f57461b29e19027d971e5842e4a.tar.bz2 |
adding defined type for ensuring presence of a samba account for a given user
user is identified by name, and a password must be given
in its current state this can only create a user (with a given password), but will not update passwords (would need to figure out how to introspect on whether an in-place password differs from plaintext password input)
also, this currently assumes/requires that a Unix user account with a matching name exists
Diffstat (limited to 'manifests/server')
-rw-r--r-- | manifests/server/user.pp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/manifests/server/user.pp b/manifests/server/user.pp new file mode 100644 index 0000000..2cffe3b --- /dev/null +++ b/manifests/server/user.pp @@ -0,0 +1,13 @@ +define samba::server::user( + $user_name = $name , + $password , + ) { + exec { "add smb account for ${user_name}": + command => "/sbin/add_samba_user '${user_name}' '${password}'" , + unless => "/sbin/check_samba_user '${user_name}'" , + require => [ + User["${user_name}"] + ] , + notify => Class['samba::server::service'] + } +} |