aboutsummaryrefslogtreecommitdiff
path: root/manifests/server/share.pp
diff options
context:
space:
mode:
Diffstat (limited to 'manifests/server/share.pp')
-rw-r--r--manifests/server/share.pp84
1 files changed, 29 insertions, 55 deletions
diff --git a/manifests/server/share.pp b/manifests/server/share.pp
index 5a6667c..c682055 100644
--- a/manifests/server/share.pp
+++ b/manifests/server/share.pp
@@ -36,14 +36,16 @@ define samba::server::share($ensure = present,
$context = $samba::server::context
$target = "target[. = '${name}']"
+ $section_changes = $ensure ? {
+ present => "set ${target} '${name}'",
+ default => "rm ${target} '${name}'",
+ }
+
augeas { "${name}-section":
incl => $incl,
lens => 'Samba.lns',
context => $context,
- changes => $ensure ? {
- present => "set ${target} '${name}'",
- default => "rm ${target} '${name}'",
- },
+ changes => $section_changes,
require => Class['samba::server::config'],
notify => Class['samba::server::service']
}
@@ -51,22 +53,22 @@ define samba::server::share($ensure = present,
if $ensure == 'present' {
$changes = [
$available ? {
- true => "set \"${target}/available\" yes",
- false => "set \"${target}/available\" no",
- default => "rm \"${target}/available\"",
- },
+ true => "set \"${target}/available\" yes",
+ false => "set \"${target}/available\" no",
+ default => "rm \"${target}/available\"",
+ },
$browsable ? {
- true => "set \"${target}/browsable\" yes",
- false => "set \"${target}/browsable\" no",
- default => "rm \"${target}/browsable\"",
+ true => "set \"${target}/browsable\" yes",
+ false => "set \"${target}/browsable\" no",
+ default => "rm \"${target}/browsable\"",
},
$comment ? {
- default => "set \"${target}/comment\" '${comment}'",
- '' => "rm \"${target}/comment\"",
+ default => "set \"${target}/comment\" '${comment}'",
+ '' => "rm \"${target}/comment\"",
},
$copy ? {
- '' => "rm \"${target}/copy\"",
- default => "set \"${target}/copy\" '${copy}'",
+ '' => "rm \"${target}/copy\"",
+ default => "set \"${target}/copy\" '${copy}'",
},
$create_mask ? {
'' => "rm \"${target}/create mask\"",
@@ -160,63 +162,35 @@ define samba::server::share($ensure = present,
false => "set \"${target}/strict allocate\" no",
default => "rm \"${target}/strict allocate\"",
},
- ]
-
- augeas { "${name}-changes":
- incl => $incl,
- lens => 'Samba.lns',
- context => $context,
- changes => $changes,
- require => Augeas["${name}-section"],
- notify => Class['samba::server::service']
- }
-
- augeas { "${name}-valid_users":
- context => $context,
- changes => $valid_users ? {
+ $valid_users ? {
'' => "rm \"${target}/valid users\"",
default => "set \"${target}/valid users\" '${valid_users}'",
},
- require => Augeas["${name}-section"],
- notify => Class['samba::server::service']
- }
-
- augeas { "${name}-op_locks":
- context => $context,
- changes => $op_locks ? {
+ $op_locks ? {
'' => "rm \"${target}/oplocks\"",
default => "set \"${target}/oplocks\" '${op_locks}'",
},
- require => Augeas["${name}-section"],
- notify => Class['samba::server::service']
- }
- augeas { "${name}-level2_oplocks":
- context => $context,
- changes => $level2_oplocks ? {
+ $level2_oplocks ? {
'' => "rm \"${target}/level2 oplocks\"",
default => "set \"${target}/level2 oplocks\" '${level2_oplocks}'",
},
- require => Augeas["${name}-section"],
- notify => Class['samba::server::service']
- }
- augeas { "${name}-veto_oplock_files":
- context => $context,
- changes => $veto_oplock_files ? {
+ $veto_oplock_files ? {
'' => "rm \"${target}/veto oplock files\"",
default => "set \"${target}/veto oplock files\" '${veto_oplock_files}'",
},
- require => Augeas["${name}-section"],
- notify => Class['samba::server::service']
- }
- augeas { "${name}-write_list":
- context => $context,
- changes => $write_list ? {
+ $write_list ? {
'' => "rm \"${target}/write list\"",
default => "set \"${target}/write list\" '${write_list}'",
},
+ ]
+
+ augeas { "${name}-changes":
+ incl => $incl,
+ lens => 'Samba.lns',
+ context => $context,
+ changes => $changes,
require => Augeas["${name}-section"],
notify => Class['samba::server::service']
}
-
}
}