From 9cae3e745987dfcb8d2332d773944ae67d439092 Mon Sep 17 00:00:00 2001 From: Andrew Seales Date: Tue, 26 May 2020 13:51:10 +0100 Subject: [PATCH] Remove `User` requirement from the samba user class: Instead of doing `require => User[..]` replace this with a collector so that if users are not managed with puppet this class still works, for example if they are in LDAP. --- manifests/server/user.pp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/manifests/server/user.pp b/manifests/server/user.pp index d10a602..9f09c9a 100644 --- a/manifests/server/user.pp +++ b/manifests/server/user.pp @@ -6,10 +6,11 @@ ) { require ::samba::server::install + User <| |> -> Samba::Server::User <| |> + exec { "add smb account for ${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'] #TODO: Is this really required?? } }