aboutsummaryrefslogtreecommitdiff
path: root/manifests/server/share.pp
diff options
context:
space:
mode:
authorVladimir Rutsky <rutsky.vladimir@gmail.com>2013-03-19 17:44:18 +0400
committerVladimir Rutsky <rutsky.vladimir@gmail.com>2013-03-19 17:44:18 +0400
commitf04f43b92a646c10cf4dc3b96b4ba3dd2453d01e (patch)
tree62fc0b9fe24d21bf4d37d8978f829acd39bf943e /manifests/server/share.pp
parentb0850bd894f4bc8fe73f4b2eca164a95d5892328 (diff)
downloadpuppet-samba-f04f43b92a646c10cf4dc3b96b4ba3dd2453d01e.tar.gz
puppet-samba-f04f43b92a646c10cf4dc3b96b4ba3dd2453d01e.tar.bz2
Support "read only", "public", "writable", "printable" options
Diffstat (limited to 'manifests/server/share.pp')
-rw-r--r--manifests/server/share.pp39
1 files changed, 38 insertions, 1 deletions
diff --git a/manifests/server/share.pp b/manifests/server/share.pp
index 552bfa1..7d308a0 100644
--- a/manifests/server/share.pp
+++ b/manifests/server/share.pp
@@ -12,7 +12,11 @@ define samba::server::share($ensure = present,
$guest_ok = '',
$guest_only = '',
$path = '',
- $read_only = '') {
+ $read_only = '',
+ $public = '',
+ $writable = '',
+ $printable = '',
+ ) {
$context = '/files/etc/samba/smb.conf'
$target = "target[. = '${name}']"
@@ -171,5 +175,38 @@ define samba::server::share($ensure = present,
require => Augeas["${name}-section"],
notify => Class['samba::server::service']
}
+
+ augeas { "${name}-public":
+ context => $context,
+ changes => $public ? {
+ true => "set \"${target}/public\" yes",
+ false => "set \"${target}/public\" no",
+ default => "rm \"${target}/public\"",
+ },
+ require => Augeas["${name}-section"],
+ notify => Class['samba::server::service']
+ }
+
+ augeas { "${name}-writable":
+ context => $context,
+ changes => $writable ? {
+ true => "set \"${target}/writable\" yes",
+ false => "set \"${target}/writable\" no",
+ default => "rm \"${target}/writable\"",
+ },
+ require => Augeas["${name}-section"],
+ notify => Class['samba::server::service']
+ }
+
+ augeas { "${name}-printable":
+ context => $context,
+ changes => $printable ? {
+ true => "set \"${target}/printable\" yes",
+ false => "set \"${target}/printable\" no",
+ default => "rm \"${target}/printable\"",
+ },
+ require => Augeas["${name}-section"],
+ notify => Class['samba::server::service']
+ }
}
}