]> gitweb.fluxo.info Git - puppet-concat.git/commitdiff
don't use a hardcoded concatdir
authorPeter Meier <peter.meier@immerda.ch>
Thu, 23 Jun 2011 09:05:43 +0000 (11:05 +0200)
committerPeter Meier <peter.meier@immerda.ch>
Thu, 23 Jun 2011 09:05:43 +0000 (11:05 +0200)
Get the concat base directory from a fact -> makes it useable if
Puppet's :vardir is not /var/lib/puppet/. This fixes problems with
PE and makes the module also useable for puppet runs as
unpriviledged user.

lib/facter/concat_basedir.rb [new file with mode: 0644]
manifests/setup.pp

diff --git a/lib/facter/concat_basedir.rb b/lib/facter/concat_basedir.rb
new file mode 100644 (file)
index 0000000..02e9c5b
--- /dev/null
@@ -0,0 +1,5 @@
+Facter.add("concat_basedir") do
+    setcode do
+        File.join(Puppet[:vardir],"concat")
+    end
+end
index fa8c7ebfbc41384309cee0fc9c2a12c5e09ded7d..5b3ad26a0af2e2fa354792e33a7b567e5a92d20d 100644 (file)
@@ -14,7 +14,7 @@
 # It also copies out the concatfragments.sh file to /usr/local/bin
 class concat::setup {
     $root_group = 0
-    $concatdir = "/var/lib/puppet/concat"
+    $concatdir = $concat_basedir
     $majorversion = regsubst($puppetversion, '^[0-9]+[.]([0-9]+)[.][0-9]+$', '\1')
 
     file{"/usr/local/bin/concatfragments.sh":