]> gitweb.fluxo.info Git - puppet-samba.git/commitdiff
ensure global section exists in case of empty config file
authorAdam Jahn <ajjahn@gmail.com>
Fri, 24 Aug 2012 15:57:15 +0000 (11:57 -0400)
committerAdam Jahn <ajjahn@gmail.com>
Fri, 24 Aug 2012 15:57:15 +0000 (11:57 -0400)
manifests/server.pp

index 811013d3aae65c70a4091bf50eae3c57b86dfbce..ce6f10c9ce39164b1ba865e451dfc14ab0222a18 100644 (file)
@@ -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
+}