diff options
author | Peter Meier <peter.meier@immerda.ch> | 2011-06-23 11:05:43 +0200 |
---|---|---|
committer | Peter Meier <peter.meier@immerda.ch> | 2011-06-23 11:05:43 +0200 |
commit | 45dfa6984cb185afc85c183152fbc6c2837e1345 (patch) | |
tree | 8e6701ea363b5cc11b47c447b7e9095310c58e75 | |
parent | cfda8dd6ac58435d017fda6311b3c2394297d09f (diff) | |
download | puppet-concat-45dfa6984cb185afc85c183152fbc6c2837e1345.tar.gz puppet-concat-45dfa6984cb185afc85c183152fbc6c2837e1345.tar.bz2 |
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.
-rw-r--r-- | lib/facter/concat_basedir.rb | 5 | ||||
-rw-r--r-- | manifests/setup.pp | 2 |
2 files changed, 6 insertions, 1 deletions
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": |