diff options
Diffstat (limited to 'manifests')
-rw-r--r-- | manifests/server.pp | 22 | ||||
-rw-r--r-- | manifests/server/ads.pp | 30 | ||||
-rw-r--r-- | manifests/server/option.pp | 19 |
3 files changed, 36 insertions, 35 deletions
diff --git a/manifests/server.pp b/manifests/server.pp index 2e4c2d9..7003057 100644 --- a/manifests/server.pp +++ b/manifests/server.pp @@ -22,8 +22,7 @@ class samba::server($interfaces = '', notify => Class['samba::server::service'] } - - set_samba_option { + samba::server::option { 'interfaces': value => $interfaces; 'bind interfaces only': value => $bind_interfaces_only; 'security': value => $security; @@ -49,24 +48,5 @@ class samba::server($interfaces = '', mode => "0755", content => template("${module_name}/add_samba_user"), } -} - -define set_samba_option ( $value = '', $signal = 'samba::server::service' ) { - $incl = $samba::server::incl - $context = $samba::server::context - $target = $samba::server::target - - $changes = $value ? { - default => "set \"${target}/$name\" \"$value\"", - '' => "rm ${target}/$name", - } - augeas { "samba-$name": - incl => $incl, - lens => 'Samba.lns', - context => $context, - changes => $changes, - require => Augeas['global-section'], - notify => Class[$signal] - } } diff --git a/manifests/server/ads.pp b/manifests/server/ads.pp index cadfee0..3d44af6 100644 --- a/manifests/server/ads.pp +++ b/manifests/server/ads.pp @@ -49,21 +49,23 @@ class samba::server::ads($ensure = present, include samba::server::config include samba::server::winbind - $signal = 'samba::server::winbind' + # notify winbind + samba::server::option { + 'realm': value => $realm, + notify => Class['Samba::Server::Winbind']; + 'winbind uid': value => $winbind_uid, + notify => Class['Samba::Server::Winbind']; + 'winbind gid': value => $winbind_gid, + notify => Class['Samba::Server::Winbind']; + 'winbind enum groups': value => $winbind_enum_groups, + notify => Class['Samba::Server::Winbind']; + 'winbind enum users': value => $winbind_enum_users, + notify => Class['Samba::Server::Winbind']; + 'winbind use default domain': value => $winbind_use_default_domain, + notify => Class['Samba::Server::Winbind']; + } - set_samba_option { - 'realm': value => $realm, - signal => $signal; - 'winbind uid': value => $winbind_uid, - signal => $signal; - 'winbind gid': value => $winbind_gid, - signal => $signal; - 'winbind enum groups': value => $winbind_enum_groups, - signal => $signal; - 'winbind enum users': value => $winbind_enum_users, - signal => $signal; - 'winbind use default domain': value => $winbind_use_default_domain, - signal => $signal; + samba::server::option { 'acl group control': value => $acl_group_control; 'map acl inherit': value => $map_acl_inherit; 'inherit acls': value => $inherit_acls; diff --git a/manifests/server/option.pp b/manifests/server/option.pp new file mode 100644 index 0000000..36968fc --- /dev/null +++ b/manifests/server/option.pp @@ -0,0 +1,19 @@ +define samba::server::option ( $value = '' ) { + $incl = $samba::server::incl + $context = $samba::server::context + $target = $samba::server::target + + $changes = $value ? { + default => "set \"${target}/$name\" \"$value\"", + '' => "rm ${target}/$name", + } + + augeas { "samba-$name": + incl => $incl, + lens => 'Samba.lns', + context => $context, + changes => $changes, + require => Augeas['global-section'], + notify => Class['Samba::Server::Service'] + } +}
\ No newline at end of file |