summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Meier <peter.meier@immerda.ch>2011-06-23 11:05:43 +0200
committerPeter Meier <peter.meier@immerda.ch>2011-06-23 11:05:43 +0200
commit45dfa6984cb185afc85c183152fbc6c2837e1345 (patch)
tree8e6701ea363b5cc11b47c447b7e9095310c58e75
parentcfda8dd6ac58435d017fda6311b3c2394297d09f (diff)
downloadpuppet-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.rb5
-rw-r--r--manifests/setup.pp2
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":