aboutsummaryrefslogtreecommitdiff
path: root/manifests/server.pp
diff options
context:
space:
mode:
Diffstat (limited to 'manifests/server.pp')
-rw-r--r--manifests/server.pp31
1 files changed, 28 insertions, 3 deletions
diff --git a/manifests/server.pp b/manifests/server.pp
index 9e5ee2e..2e4c2d9 100644
--- a/manifests/server.pp
+++ b/manifests/server.pp
@@ -9,10 +9,13 @@ class samba::server($interfaces = '',
include samba::server::config
include samba::server::service
- $context = '/files/etc/samba/smb.conf'
- $target = "target[. = 'global']"
+ $incl = '/etc/samba/smb.conf'
+ $context = "/files/etc/samba/smb.conf"
+ $target = "target[. = 'global']"
augeas { 'global-section':
+ incl => $incl,
+ lens => 'Samba.lns',
context => $context,
changes => "set ${target} global",
require => Class['samba::server::config'],
@@ -28,17 +31,39 @@ class samba::server($interfaces = '',
'unix password sync': value => $unix_password_sync;
'workgroup': value => $workgroup;
}
+
+ file {'check_samba_user':
+ # script checks to see if a samba account exists for a given user
+ path => '/sbin/check_samba_user',
+ owner => root,
+ group => root,
+ mode => "0755",
+ content => template("${module_name}/check_samba_user"),
+ }
+
+ file {'add_samba_user':
+ # script creates a new samba account for a given user and password
+ path => '/sbin/add_samba_user',
+ owner => root,
+ group => root,
+ mode => "0755",
+ content => template("${module_name}/add_samba_user"),
+ }
}
define set_samba_option ( $value = '', $signal = 'samba::server::service' ) {
+ $incl = $samba::server::incl
$context = $samba::server::context
- $target = $samba::server::target
+ $target = $samba::server::target
+
$changes = $value ? {
default => "set \"${target}/$name\" \"$value\"",
'' => "rm ${target}/$name",
}
augeas { "samba-$name":
+ incl => $incl,
+ lens => 'Samba.lns',
context => $context,
changes => $changes,
require => Augeas['global-section'],