diff options
Diffstat (limited to 'manifests/share.pp')
-rw-r--r-- | manifests/share.pp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/manifests/share.pp b/manifests/share.pp new file mode 100644 index 0000000..7690fbc --- /dev/null +++ b/manifests/share.pp @@ -0,0 +1,26 @@ +define samba::share($ensure=present, + $description, + $path, + $browsable, + $mask, + $guestok="no", + $readonly="no" ) { + + $share = $name + $context = "/files/etc/samba/smb.conf" + $target = "target[. = '${name}']" + + augeas { "${share}": + context => $context, + changes => $ensure ? { + present => [ "set ${target} ${name}", + "set ${target}/comment ${description}", + "set ${target}/path ${path}", + "set ${target}/browsable ${browsable}", + "set ${target}/mask ${mask}" ], + default => ["rm ${target} ${name}"], + }, + require => Class["samba::server::config"] + } + +} |