Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

Commit

Permalink
Add path to execs
Browse files Browse the repository at this point in the history
  • Loading branch information
raphink committed Nov 4, 2014
1 parent 21a8bda commit a627bc3
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
4 changes: 4 additions & 0 deletions manifests/download.pp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
$allow_insecure=false,
$follow_redirects=false,
$verbose=true,
$path=$::path,
) {

$insecure_arg = $allow_insecure ? {
Expand Down Expand Up @@ -85,6 +86,7 @@
command => "curl -s -S ${insecure_arg} ${redirect_arg} -o ${src_target}/${name}.${digest_type} '${digest_src}'",
creates => "${src_target}/${name}.${digest_type}",
timeout => $timeout,
path => $path,
notify => Exec["download archive ${name} and check sum"],
require => Package['curl'],
}
Expand Down Expand Up @@ -149,6 +151,7 @@
creates => "${src_target}/${name}",
logoutput => true,
timeout => $timeout,
path => $path,
require => Package['curl'],
notify => $_notify,
refreshonly => $refreshonly,
Expand All @@ -158,6 +161,7 @@
command => "rm -f ${src_target}/${name} ${src_target}/${name}.${digest_type} && exit 1",
unless => $checksum_cmd,
cwd => $src_target,
path => $path,
refreshonly => true,
}
}
Expand Down
5 changes: 4 additions & 1 deletion manifests/extract.pp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@
$src_target='/usr/src',
$root_dir='',
$extension='tar.gz',
$timeout=120) {
$timeout=120,
$path=$::path,
) {

if $root_dir != '' {
$extract_dir = "${target}/${root_dir}"
Expand All @@ -61,6 +63,7 @@
command => $command,
creates => $extract_dir,
timeout => $timeout
path => $path,
}
}
absent: {
Expand Down
3 changes: 2 additions & 1 deletion manifests/tar_gz.pp
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# See README.md for details.
define archive::tar_gz($source, $target) {
define archive::tar_gz($source, $target, $path=$::path) {
exec {"${name} unpack":
command => "curl -s -S ${source} | tar -xzf - -C ${target} && touch ${name}",
creates => $name,
path => $path,
require => Package[curl],
}
}
3 changes: 2 additions & 1 deletion manifests/zip.pp
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# See README.md for details.
define archive::zip($source, $target) {
define archive::zip($source, $target, $path = $::path) {
exec {"${name} unpack":
command => "TMPFILE=\$(mktemp); curl -s -S -o \${TMPFILE}.zip ${source} && unzip \${TMPFILE}.zip -d ${target} && rm \$TMPFILE && rm \${TMPFILE}.zip && touch ${name}",
creates => $name,
path => $::path,
require => Package['unzip'],
}
}

0 comments on commit a627bc3

Please sign in to comment.