Jump To …

deploy.pp

Define: staging::deploy

The define resource extracts compressed file to a staging location.

Parameters:

  • [source]: the source file location, supports local files, puppet://, http://, https://, ftp:// (default: )
  • [target]: the target extraction directory (default: )
  • [staging_path]: the staging location for compressed file. defaults to ${staging::path}/${caller_module_name} (default: undef)
  • [username]: https or ftp username (default: undef)
  • [certificate]: https certifcate file (default: undef)
  • [password]: https or ftp user password or https certificate password (default: undef)
  • [environment]: environment variable for settings such as http_proxy (default: undef)
  • [timeout]: the time to wait for the file transfer to complete (default: undef)
  • [user]: extract file as this user (default: undef)
  • [group]: extract group as this group (default: undef)
  • [creates]: the file/folder created after extraction. if unspecified defaults to ${target}/${name} (default: undef)
  • [unless]: alternative way to conditionally extract file (default: undef)
  • [onlyif]: alternative way to conditionally extract file (default: undef)

Usage:

staging::deploy { 'sample.tar.gz':
  source => 'puppet:///modules/staging/sample.tar.gz',
  target => '/usr/local',
}
define staging::deploy (
  $source,               
  $target,               
  $staging_path = undef, 
  $username     = undef, 
  $certificate  = undef, 
  $password     = undef, 
  $environment  = undef, 
  $timeout      = undef, 
  $user         = undef, 
  $group        = undef, 
  $creates      = undef, 
  $unless       = undef, 
  $onlyif       = undef  
) {

  staging::file { $name:
    source      => $source,
    target      => $staging_path,
    username    => $username,
    certificate => $certificate,
    password    => $password,
    environment => $environment,
    subdir      => $caller_module_name,
    timeout     => $timeout,
  }

  staging::extract { $name:
    target      => $target,
    source      => $staging_path,
    user        => $user,
    group       => $group,
    environment => $environment,
    subdir      => $caller_module_name,
    creates     => $creates,
    unless      => $unless,
    onlyif      => $onlyif,
    require     => Staging::File[$name],
  }

}