aboutsummaryrefslogtreecommitdiff
path: root/manifests/server.pp
diff options
context:
space:
mode:
authorAdam Jahn <ajjahn@gmail.com>2012-08-24 11:57:15 -0400
committerAdam Jahn <ajjahn@gmail.com>2012-08-24 11:57:15 -0400
commit9e16baf39baffc185f57df0227b0d3a314e50990 (patch)
tree5dc17527426b1a6185612bfcd6350f46d89a1629 /manifests/server.pp
parentb27da34ecdd31184b3123b8f023bee24155446f1 (diff)
downloadpuppet-samba-9e16baf39baffc185f57df0227b0d3a314e50990.tar.gz
puppet-samba-9e16baf39baffc185f57df0227b0d3a314e50990.tar.bz2
ensure global section exists in case of empty config file
Diffstat (limited to 'manifests/server.pp')
-rw-r--r--manifests/server.pp11
1 files changed, 7 insertions, 4 deletions
diff --git a/manifests/server.pp b/manifests/server.pp
index 811013d..ce6f10c 100644
--- a/manifests/server.pp
+++ b/manifests/server.pp
@@ -2,12 +2,15 @@ class samba::server($workgroup = PCCH) {
include samba::server::install
include samba::server::config
include samba::server::service
-
+
+ $target = "target[. = 'global']"
+
augeas { global:
context => "/files/etc/samba/smb.conf",
changes => [
- "set target[. = 'global']/workgroup $workgroup"
- ],
+ "set ${target} global",
+ "set ${target}/workgroup $workgroup"
+ ],
require => Class["samba::server::config"]
}
-} \ No newline at end of file
+}