Forge Home

download_uncompress

Utility to download and uncompress software distributions in a given directory

220,470 downloads

59,992 latest version

5.0 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Support the Puppet Community by contributing to this module

You are welcome to contribute to this module by suggesting new features, currency updates, or fixes. Every contribution is valuable to help ensure that the module remains compatible with the latest Puppet versions and continues to meet community needs. Complete the following steps:

  1. Review the module’s contribution guidelines and any licenses. Ensure that your planned contribution aligns with the author’s standards and any legal requirements.
  2. Fork the repository on GitHub, make changes on a branch of your fork, and submit a pull request. The pull request must clearly document your proposed change.

For questions about updating the module, contact the module’s author.

Version information

  • 1.5.1 (latest)
  • 1.5.0
  • 1.4.1
  • 1.4.0
  • 1.3.3
  • 1.3.2
  • 1.3.1
  • 1.3.0
  • 1.2.0
  • 1.1.1
  • 1.1.0
  • 1.0.3
  • 1.0.2
  • 1.0.1
  • 1.0.0
released Nov 20th 2018
This version is compatible with:
  • Puppet Enterprise 2023.8.x, 2023.7.x, 2023.6.x, 2023.5.x, 2023.4.x, 2023.3.x, 2023.2.x, 2023.1.x, 2023.0.x, 2021.7.x, 2021.6.x, 2021.5.x, 2021.4.x, 2021.3.x, 2021.2.x, 2021.1.x, 2021.0.x, 2019.8.x, 2019.7.x, 2019.5.x, 2019.4.x, 2019.3.x, 2019.2.x, 2019.1.x, 2019.0.x, 2018.1.x, 2017.3.x, 2017.2.x, 2017.1.x, 2016.5.x, 2016.4.x
  • Puppet >= 4.0.0
  • Ubuntu, Debian, RedHat, CentOS

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'dsestero-download_uncompress', '1.5.1'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add dsestero-download_uncompress
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install dsestero-download_uncompress --version 1.5.1

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Download

Documentation

dsestero/download_uncompress — version 1.5.1 Nov 20th 2018

#download_uncompress

####Table of Contents

  1. Overview
  2. Module Description - What the module does and why it is useful
  3. Setup - The basics of getting started with download_uncompress
  4. Usage - Configuration options and additional functionality
  5. Reference - An under-the-hood peek at what the module is doing and how
  6. Limitations - OS compatibility, etc.
  7. Development - Guide for contributing to the module

##Overview

This is the download_uncompress module. It allows to download and uncompress a software distribution in a specified directory.

##Module Description

The module provides a utility define that takes care to download and uncompress a software distribution in a specified directory. The software distribution can be uncompressed with unzip or untar or leaved as it is. The operations are performed only if the expected file or folder does not yet exists.

##Setup

###What download_uncompress affects

The module installs the unzip package if it is not installed using stdlib ensure_packages type.

The module performs a wget from the specified url into the /tmp directory and possibly unzip the downloaded file into the destination folder. The base_url from which to download can be provided as a parameter and defaults to the value of the key distributions_base_url defined in hiera.

###Setup Requirements

This modules requires the following other modules to be installed:

  • puppetlabs/stdlib

    to use the ensure_packages resource.

###Beginning with download_uncompress

To download and unzip SoftwareXY.zip from the base url specified by the key distributions_base_url defined in hiera, it is possible to use a declaration as the following:

download_uncompress {'dwnl_inst_swxy':
   download_base_url  => 'http://jee.invallee.it/dist',
   distribution_name  => 'SoftwareXY.zip'
   dest_folder   => '/tmp',
   creates       => '/tmp/SXYInstallFolder',
   uncompress    => 'tar.gz',
}

##Usage

It is convenient to specify via hiera the default base url to be used to download software distributions; typically it would be some kind of internal repository where software binary packages are made available. An example hiera (JSON) declaration would be as follows:

{
  "distributions_base_url" : "http://site.x.y/dist"
}

Then, a typical declaration would be:

  download_uncompress { 'install_jboss_5':
    distribution_name => 'jboss-5.1.0.GA-jdk6.zip',
    dest_folder       => '/opt',
    creates           => '/opt/jboss-5.1.0.GA',
    uncompress        => 'zip',
    user              => jboss,
    group             => jboss,
  }

Alternatively, the base url can be given as a parameter:

  download_uncompress { 'install_jboss-4.2.3.GA':
    download_base_url => 'http://sourceforge.net/projects/jboss/files/JBoss',
    distribution_name => "JBoss-4.2.3.GA/jboss-4.2.3-jdk6.zip/download",
    dest_folder       => '/opt',
    creates           => '/opt/jboss-4.2.3.GA',
    uncompress        => 'zip',
    user              => jboss,
    group             => jboss,
  }

Or, the full url can be specified in one place:

  download_uncompress { 'install_jboss-4.2.3.GA':
    distribution_name => 'http://sourceforge.nt/projects/jboss/files/JBoss/JBoss-4.2.3.GA/jboss-4.2.3-jdk6.zip/download',
    dest_folder       => '/opt',
    creates           => '/opt/jboss-4.2.3.GA',
    uncompress        => 'zip',
    user              => jboss,
    group             => jboss,
  }

Another example, to put in place a JBoss library (no uncompression in this case):

  download_uncompress { "${postgresqlModulePath}/postgresql-9.1-903.jdbc4.jar":
    distribution_name => 'lib/postgresql-9.1-903.jdbc4.jar',
    dest_folder       => "${postgresqlModulePath}",
    creates           => "${postgresqlModulePath}/postgresql-9.1-903.jdbc4.jar",
    user              => jboss,
    group             => jboss,
  }

##Development

If you need some feature please send me a (pull) request or send me an email at: dsestero 'at' gmail 'dot' com.