diff options
Diffstat (limited to 'manifests')
-rw-r--r-- | manifests/server.pp | 22 | ||||
-rw-r--r-- | manifests/server/share.pp | 66 |
2 files changed, 44 insertions, 44 deletions
diff --git a/manifests/server.pp b/manifests/server.pp index b552578..b8e94b0 100644 --- a/manifests/server.pp +++ b/manifests/server.pp @@ -1,5 +1,6 @@ -class samba::server($workgroup = '', - $server_string = '') { +class samba::server($server_string = '', + $workgroup = '') { + include samba::server::install include samba::server::config include samba::server::service @@ -14,24 +15,23 @@ class samba::server($workgroup = '', notify => Class['samba::server::service'] } - augeas { 'global-workgroup': + augeas { 'global-server_string': context => $context, - changes => $workgroup ? { - default => "set ${target}/workgroup '$workgroup'", - '' => "rm ${target}/workgroup", + changes => $server_string ? { + default => "set \"${target}/server string\" '$server_string'", + '' => "rm \"${target}/server string\"", }, require => Augeas['global-section'], notify => Class['samba::server::service'] } - augeas { 'global-server_string': + augeas { 'global-workgroup': context => $context, - changes => $server_string ? { - default => "set \"${target}/server string\" '$server_string'", - '' => "rm \"${target}/server string\"", + changes => $workgroup ? { + default => "set ${target}/workgroup '$workgroup'", + '' => "rm ${target}/workgroup", }, require => Augeas['global-section'], notify => Class['samba::server::service'] } - } diff --git a/manifests/server/share.pp b/manifests/server/share.pp index 22686b5..27f6047 100644 --- a/manifests/server/share.pp +++ b/manifests/server/share.pp @@ -1,18 +1,18 @@ define samba::server::share($ensure = present, - $comment = '', - $path = '', - $browsable = '', - $copy = '', - $create_mask = '', - $directory_mask = '', - $force_create_mask = '', - $force_directory_mask = '', - $force_group = '', - $force_user = '', - $guest_account = '', - $guest_ok = '', - $guest_only = '', - $read_only = '') { + $browsable = '', + $comment = '', + $copy = '', + $create_mask = '', + $directory_mask = '', + $force_create_mask = '', + $force_directory_mask = '', + $force_group = '', + $force_user = '', + $guest_account = '', + $guest_ok = '', + $guest_only = '', + $path = '', + $read_only = '') { $context = "/files/etc/samba/smb.conf" $target = "target[. = '${name}']" @@ -28,32 +28,22 @@ define samba::server::share($ensure = present, } if $ensure == "present" { - augeas { "${name}-comment": - context => $context, - changes => $comment ? { - default => "set ${target}/comment '${comment}'", - '' => "rm ${target}/comment", - }, - require => Augeas["${name}-section"], - notify => Class["samba::server::service"] - } - - augeas { "${name}-path": + augeas { "${name}-browsable": context => $context, - changes => $path ? { - default => "set ${target}/path '${path}'", - '' => "rm ${target}/path", + changes => $browsable ? { + true => "set ${target}/browsable yes", + false => "set ${target}/browsable no", + default => "rm ${target}/browsable", }, require => Augeas["${name}-section"], notify => Class["samba::server::service"] } - augeas { "${name}-browsable": + augeas { "${name}-comment": context => $context, - changes => $browsable ? { - true => "set ${target}/browsable yes", - false => "set ${target}/browsable no", - default => "rm ${target}/browsable", + changes => $comment ? { + default => "set ${target}/comment '${comment}'", + '' => "rm ${target}/comment", }, require => Augeas["${name}-section"], notify => Class["samba::server::service"] @@ -161,6 +151,16 @@ define samba::server::share($ensure = present, notify => Class["samba::server::service"] } + augeas { "${name}-path": + context => $context, + changes => $path ? { + default => "set ${target}/path '${path}'", + '' => "rm ${target}/path", + }, + require => Augeas["${name}-section"], + notify => Class["samba::server::service"] + } + augeas { "${name}-read_only": context => $context, changes => $read_only ? { |