From 9d63c7be3fa57e4af93c787f8b740658ec14f1f6 Mon Sep 17 00:00:00 2001 From: Alexander Fisher Date: Fri, 22 Jan 2016 15:32:28 +0000 Subject: Remove check_samba_user and add_samba_user scripts Call the pdbedit commands directly from samba::server::user instead --- manifests/server/user.pp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'manifests/server') diff --git a/manifests/server/user.pp b/manifests/server/user.pp index b8f2e61..d10a602 100644 --- a/manifests/server/user.pp +++ b/manifests/server/user.pp @@ -4,10 +4,12 @@ define samba::server::user ( $password, $user_name = $name, ) { + require ::samba::server::install + exec { "add smb account for ${user_name}": - command => "/sbin/add_samba_user '${user_name}' '${password}'" , - unless => "/sbin/check_samba_user '${user_name}'" , + command => "/bin/echo -e '${password}\\n${password}\\n' | /usr/bin/pdbedit --password-from-stdin -a '${user_name}'", + unless => "/usr/bin/pdbedit '${user_name}'", require => [ User[$user_name] ], - notify => Class['samba::server::service'] + notify => Class['samba::server::service'] #TODO: Is this really required?? } } -- cgit v1.2.3