aboutsummaryrefslogtreecommitdiff
path: root/manifests/server/user.pp
blob: d10a602a3558d633b03d86269d87fe1aad6255a9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# == Class samba::server::user
#
define samba::server::user (
  $password,
  $user_name = $name,
) {
  require ::samba::server::install

  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??
  }
}