From 45dfa6984cb185afc85c183152fbc6c2837e1345 Mon Sep 17 00:00:00 2001 From: Peter Meier Date: Thu, 23 Jun 2011 11:05:43 +0200 Subject: don't use a hardcoded concatdir 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 | 5 +++++ manifests/setup.pp | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 lib/facter/concat_basedir.rb diff --git a/lib/facter/concat_basedir.rb b/lib/facter/concat_basedir.rb new file mode 100644 index 0000000..02e9c5b --- /dev/null +++ b/lib/facter/concat_basedir.rb @@ -0,0 +1,5 @@ +Facter.add("concat_basedir") do + setcode do + File.join(Puppet[:vardir],"concat") + end +end diff --git a/manifests/setup.pp b/manifests/setup.pp index fa8c7eb..5b3ad26 100644 --- a/manifests/setup.pp +++ b/manifests/setup.pp @@ -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": -- cgit v1.2.3