]> git.donarmstrong.com Git - dsa-puppet.git/blob - 3rdparty/modules/staging/manifests/deploy.pp
add nanliu/staging to 3rdparty
[dsa-puppet.git] / 3rdparty / modules / staging / manifests / deploy.pp
1 # The define resource extracts compressed file to a staging location.
2 define staging::deploy (
3   $source,               #: the source file location, supports local files, puppet://, http://, https://, ftp://
4   $target,               #: the target extraction directory
5   $staging_path = undef, #: the staging location for compressed file. defaults to ${staging::path}/${caller_module_name}
6   $username     = undef, #: https or ftp username
7   $certificate  = undef, #: https certifcate file
8   $password     = undef, #: https or ftp user password or https certificate password
9   $environment  = undef, #: environment variable for settings such as http_proxy
10   $timeout      = undef, #: the time to wait for the file transfer to complete
11   $user         = undef, #: extract file as this user
12   $group        = undef, #: extract group as this group
13   $creates      = undef, #: the file/folder created after extraction. if unspecified defaults to ${target}/${name}
14   $unless       = undef, #: alternative way to conditionally extract file
15   $onlyif       = undef  #: alternative way to conditionally extract file
16 ) {
17
18   staging::file { $name:
19     source      => $source,
20     target      => $staging_path,
21     username    => $username,
22     certificate => $certificate,
23     password    => $password,
24     environment => $environment,
25     subdir      => $caller_module_name,
26     timeout     => $timeout,
27   }
28
29   staging::extract { $name:
30     target      => $target,
31     source      => $staging_path,
32     user        => $user,
33     group       => $group,
34     environment => $environment,
35     subdir      => $caller_module_name,
36     creates     => $creates,
37     unless      => $unless,
38     onlyif      => $onlyif,
39     require     => Staging::File[$name],
40   }
41
42 }