diff options
author | Vladislav Nazarenko <vladislav.nazarenko@dvag.com> | 2014-01-03 14:31:55 +0100 |
---|---|---|
committer | Vladislav Nazarenko <vladislav.nazarenko@dvag.com> | 2014-01-03 14:31:55 +0100 |
commit | e9be6b324468dd380c501ba71fe297d9d92da50a (patch) | |
tree | 3638a7583ced0f90d73ef1190cf78734c20e868b /manifests/server.pp | |
parent | 63d27babd8e779fce6248afb94e9f49ff7d74ef2 (diff) | |
download | puppet-samba-e9be6b324468dd380c501ba71fe297d9d92da50a.tar.gz puppet-samba-e9be6b324468dd380c501ba71fe297d9d92da50a.tar.bz2 |
FIX: augeas runtime optimization (~4 sec per augeas resource)
Diffstat (limited to 'manifests/server.pp')
-rw-r--r-- | manifests/server.pp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/manifests/server.pp b/manifests/server.pp index bc1e3d7..0dfda00 100644 --- a/manifests/server.pp +++ b/manifests/server.pp @@ -8,10 +8,13 @@ class samba::server($interfaces = '', include samba::server::config include samba::server::service - $context = '/files/etc/samba/smb.conf' - $target = "target[. = 'global']" + $incl = '/etc/samba/smb.conf' + $context = "/files/etc/samba/smb.conf" + $target = "target[. = 'global']" augeas { 'global-section': + incl => $incl, + lens => 'Samba.lns', context => $context, changes => "set ${target} global", require => Class['samba::server::config'], @@ -30,14 +33,18 @@ class samba::server($interfaces = '', } define set_samba_option ( $value = '', $signal = 'samba::server::service' ) { + $incl = $samba::server::incl $context = $samba::server::context - $target = $samba::server::target + $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'], |