From 821bb50151990f57461b29e19027d971e5842e4a Mon Sep 17 00:00:00 2001 From: jonoterc Date: Thu, 10 Oct 2013 17:34:49 -0400 Subject: 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 --- manifests/server/user.pp | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 manifests/server/user.pp (limited to 'manifests') 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'] + } +} -- cgit v1.2.3