diff options
-rw-r--r-- | manifests/server/share.pp | 39 |
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'] + } } } |