Sha256: cbebd7cc5ef0c38adf9664fc027fadb86e8698bdcf7dc821050014ed16c2dbc1

Contents?: true

Size: 1.6 KB

Versions: 7

Compression:

Stored size: 1.6 KB

Contents

/*

== Definition: archive

Download and extract an archive.

Parameters:

- *$url:
- *$target: Destination directory
- *$checksum: Default value "true"
- *$digest_url: Default value ""
- *$digest_string: Default value ""
- *$digest_type: Default value "md5"
- *$src_target: Default value "/usr/src"
- *$root_dir: Default value ""
- *$extension: Default value ".tar.gz"
- *$timeout: Default value 120
- *$allow_insecure: Default value false
- *$onlyif: Expression console to test if we have to execute this class

Example usage:

  archive {"apache-tomcat-6.0.26":
    ensure => present,
    url    => "http://archive.apache.org/dist/tomcat/tomcat-6/v6.0.26/bin/apache-tomcat-6.0.26.tar.gz",
    target => "/opt",
  }

*/
define archive (
  $url,
  $target,
  $ensure=present,
  $checksum=true,
  $digest_url='',
  $digest_string='',
  $digest_type='md5',
  $timeout=120,
  $root_dir='',
  $extension='tar.gz',
  $src_target='/usr/src',
  $allow_insecure=true,
  $onlyif = "true",
) {

  archive::download {"${name}.${extension}":
    ensure         => $ensure,
    url            => $url,
    checksum       => $checksum,
    digest_url     => $digest_url,
    digest_string  => $digest_string,
    digest_type    => $digest_type,
    timeout        => $timeout,
    src_target     => $src_target,
    allow_insecure => $allow_insecure,
  }

  archive::extract {$name:
    ensure     => $ensure,
    target     => $target,
    src_target => $src_target,
    root_dir   => $root_dir,
    extension  => $extension,
    timeout    => $timeout,
    onlyif => $onlyif,
    require    => Archive::Download["${name}.${extension}"]
  }  

}

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
rubyipmi-0.10.0 spec/puppetmodules/archive/manifests/init.pp
rubyipmi-0.9.3 spec/puppetmodules/archive/manifests/init.pp
rubyipmi-0.9.2 spec/puppetmodules/archive/manifests/init.pp
rubyipmi-0.9.1 spec/puppetmodules/archive/manifests/init.pp
rubyipmi-0.9.0 spec/puppetmodules/archive/manifests/init.pp
rubyipmi-0.8.1 spec/puppetmodules/archive/manifests/init.pp
rubyipmi-0.7.0 spec/puppetmodules/archive/manifests/init.pp