diff options
author | R.I.Pienaar <rip@devco.net> | 2011-08-03 06:44:57 -0700 |
---|---|---|
committer | R.I.Pienaar <rip@devco.net> | 2011-08-03 06:44:57 -0700 |
commit | 0cd6bacfc92e581a988c2c82cc23472dff63a8b0 (patch) | |
tree | 19c3cdc42964dbb3c06edb8e99b607abdbf86ef3 /manifests/init.pp | |
parent | 4a08cd40b5cace62afa1070311245e2379789cb8 (diff) | |
parent | 185adddae8cbba57891167cef05b94a8b3e25171 (diff) | |
download | puppet-concat-0cd6bacfc92e581a988c2c82cc23472dff63a8b0.tar.gz puppet-concat-0cd6bacfc92e581a988c2c82cc23472dff63a8b0.tar.bz2 |
Merge pull request #8 from duritong/master
use client's vardir - make module usable for unprivileged users
Diffstat (limited to 'manifests/init.pp')
-rw-r--r-- | manifests/init.pp | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/manifests/init.pp b/manifests/init.pp index 3a17346..19d91a1 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -44,9 +44,9 @@ # # DETAIL: # We use a helper shell script called concatfragments.sh that gets placed -# in /usr/local/bin to do the concatenation. While this might seem more -# complex than some of the one-liner alternatives you might find on the net -# we do a lot of error checking and safety checks in the script to avoid +# in <Puppet[:vardir]>/concat/bin to do the concatenation. While this might +# seem more complex than some of the one-liner alternatives you might find on +# the net we do a lot of error checking and safety checks in the script to avoid # problems that might be caused by complex escaping errors etc. # # LICENSE: @@ -87,7 +87,7 @@ # ALIASES: # - The exec can notified using Exec["concat_/path/to/file"] or Exec["concat_/path/to/directory"] # - The final file can be referened as File["/path/to/file"] or File["concat_/path/to/file"] -define concat($mode = 0644, $owner = "root", $group = $concat::setup::root_group, $warn = "false", $force = "false", $backup = "puppet", $gnu = "true", $order="alpha") { +define concat($mode = 0644, $owner = $id, $group = $concat::setup::root_group, $warn = "false", $force = "false", $backup = "puppet", $gnu = "true", $order="alpha") { $safe_name = regsubst($name, '/', '_', 'G') $concatdir = $concat::setup::concatdir $version = $concat::setup::majorversion @@ -126,7 +126,7 @@ define concat($mode = 0644, $owner = "root", $group = $concat::setup::root_group } File{ - owner => root, + owner => $id, group => $group, mode => $mode, backup => $backup @@ -164,13 +164,17 @@ define concat($mode = 0644, $owner = "root", $group = $concat::setup::root_group } exec{"concat_${name}": - user => root, - group => $group, notify => File[$name], subscribe => File[$fragdir], alias => "concat_${fragdir}", - require => [ File["/usr/local/bin/concatfragments.sh"], File[$fragdir], File["${fragdir}/fragments"], File["${fragdir}/fragments.concat"] ], - unless => "/usr/local/bin/concatfragments.sh -o ${fragdir}/${concat_name} -d ${fragdir} -t ${warnflag} ${forceflag} ${orderflag} ${gnuflag}", - command => "/usr/local/bin/concatfragments.sh -o ${fragdir}/${concat_name} -d ${fragdir} ${warnflag} ${forceflag} ${orderflag} ${gnuflag}", + require => [ File[$fragdir], File["${fragdir}/fragments"], File["${fragdir}/fragments.concat"] ], + unless => "${concat::setup::concatdir}/bin/concatfragments.sh -o ${fragdir}/${concat_name} -d ${fragdir} -t ${warnflag} ${forceflag} ${orderflag} ${gnuflag}", + command => "${concat::setup::concatdir}/bin/concatfragments.sh -o ${fragdir}/${concat_name} -d ${fragdir} ${warnflag} ${forceflag} ${orderflag} ${gnuflag}", + } + if $id == 'root' { + Exec["concat_${name}"]{ + user => root, + group => $group, + } } } |