aboutsummaryrefslogtreecommitdiff
path: root/manifests/server.pp
diff options
context:
space:
mode:
authorAdam Jahn <ajjahn@gmail.com>2012-08-24 12:27:26 -0400
committerAdam Jahn <ajjahn@gmail.com>2012-08-24 12:27:26 -0400
commit7c10f82e1bf5e0d79283efdcffe154f3411486ee (patch)
treebc875f6e64802465b1cc29dafb0047ff330c4ceb /manifests/server.pp
parent9e16baf39baffc185f57df0227b0d3a314e50990 (diff)
downloadpuppet-samba-7c10f82e1bf5e0d79283efdcffe154f3411486ee.tar.gz
puppet-samba-7c10f82e1bf5e0d79283efdcffe154f3411486ee.tar.bz2
workgroup should be optional and generic
Diffstat (limited to 'manifests/server.pp')
-rw-r--r--manifests/server.pp22
1 files changed, 15 insertions, 7 deletions
diff --git a/manifests/server.pp b/manifests/server.pp
index ce6f10c..6addab8 100644
--- a/manifests/server.pp
+++ b/manifests/server.pp
@@ -1,16 +1,24 @@
-class samba::server($workgroup = PCCH) {
+class samba::server($workgroup = '') {
include samba::server::install
include samba::server::config
include samba::server::service
+ $context = "/files/etc/samba/smb.conf"
$target = "target[. = 'global']"
- augeas { global:
- context => "/files/etc/samba/smb.conf",
- changes => [
- "set ${target} global",
- "set ${target}/workgroup $workgroup"
- ],
+ augeas { 'global-section':
+ context => $context,
+ changes => "set ${target} global",
require => Class["samba::server::config"]
}
+
+ augeas { 'global-workgroup':
+ context => $context,
+ changes => $workgroup ? {
+ default => "set ${target}/workgroup $workgroup",
+ '' => "rm ${target}/workgroup",
+ },
+ require => Augeas['global-section'],
+ }
+
}