]> gitweb.fluxo.info Git - puppet-samba.git/commitdiff
adding defined type for ensuring presence of a samba account for a given user
authorjonoterc <jon_obuchowski@terc.edu>
Thu, 10 Oct 2013 21:34:49 +0000 (17:34 -0400)
committerAdam Jahn <ajjahn@gmail.com>
Fri, 10 Jan 2014 23:15:58 +0000 (18:15 -0500)
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

manifests/server/user.pp [new file with mode: 0644]

diff --git a/manifests/server/user.pp b/manifests/server/user.pp
new file mode 100644 (file)
index 0000000..2cffe3b
--- /dev/null
@@ -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']
+       }
+}