diff options
| author | Alexander Fisher <alex@linfratech.co.uk> | 2016-01-22 15:32:28 +0000 | 
|---|---|---|
| committer | Alexander Fisher <alex@linfratech.co.uk> | 2016-01-22 15:38:12 +0000 | 
| commit | 9d63c7be3fa57e4af93c787f8b740658ec14f1f6 (patch) | |
| tree | 17641909f729f4980bc5ff10f241f032f98dfa4f /manifests | |
| parent | 037949461d7b064adc0b041207bc026cdabf8a27 (diff) | |
| download | puppet-samba-9d63c7be3fa57e4af93c787f8b740658ec14f1f6.tar.gz puppet-samba-9d63c7be3fa57e4af93c787f8b740658ec14f1f6.tar.bz2  | |
Remove check_samba_user and add_samba_user scripts
Call the pdbedit commands directly from samba::server::user instead
Diffstat (limited to 'manifests')
| -rw-r--r-- | manifests/server.pp | 16 | ||||
| -rw-r--r-- | manifests/server/user.pp | 8 | 
2 files changed, 5 insertions, 19 deletions
diff --git a/manifests/server.pp b/manifests/server.pp index 550659c..8a5853c 100644 --- a/manifests/server.pp +++ b/manifests/server.pp @@ -58,20 +58,4 @@ class samba::server($interfaces = '',      'os level':             value => $os_level;      'preferred master':     value => $preferred_master;    } - -  file {'/sbin/check_samba_user': -    # script checks to see if a samba account exists for a given user -    owner   => root, -    group   => root, -    mode    => '0755', -    content => template("${module_name}/check_samba_user"), -  } - -  file {'/sbin/add_samba_user': -    # script creates a new samba account for a given user and password -    owner   => root, -    group   => root, -    mode    => '0755', -    content => template("${module_name}/add_samba_user"), -  }  } 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??    }  }  | 
