aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladislav Nazarenko <vladislav.nazarenko@dvag.com>2014-01-17 13:55:55 +0100
committerVladislav Nazarenko <vladislav.nazarenko@dvag.com>2014-01-17 13:55:55 +0100
commitf321b3a1e0fbed665ef92776dffb1abb064a9f84 (patch)
tree4e2d2dce49a8c3122f4aec82c3eb72bd98cc4b35
parent7d0c9a893efae039252e754ed7750b4bcdf25f9a (diff)
downloadpuppet-samba-f321b3a1e0fbed665ef92776dffb1abb064a9f84.tar.gz
puppet-samba-f321b3a1e0fbed665ef92776dffb1abb064a9f84.tar.bz2
moved set_samba_option to own file an renamed it to samba::server::option
-rw-r--r--manifests/server.pp22
-rw-r--r--manifests/server/ads.pp30
-rw-r--r--manifests/server/option.pp19
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