download_and_do

Download a file from somewhere and do something with it (eg run...)

Geoff Williams

geoffwilliams

10,027 downloads

4,542 latest version

1.9 quality score

Version information

  • 0.9.2 (latest)
  • 0.9.1
  • 0.9.0
  • 0.8.0
  • 0.7.0
  • 0.6.0
  • 0.5.0
  • 0.4.0
  • 0.3.0
  • 0.2.0
  • 0.1.0
released Aug 28th 2018

Start using this module

Documentation

geoffwilliams/download_and_do — version 0.9.2 Aug 28th 2018

download_and_do

Table of Contents

  1. Description
  2. Usage - Configuration options and additional functionality
  3. Limitations - OS compatibility, etc.
  4. Development - Guide for contributing to the module

Description

Download files using puppet-archive, then either run directly or unpack and run a command.

Usage

Download, Extract, Run

include download_and_do
download_and_do::extract_and_run { "test.tar.gz":
  source       => "http://blah/cut/spec/fixtures/test.tar.gz",
  run_relative => "cp test.txt /extract_and_run",
}

Download from source to title, then perform the command at run_relative. Pass the creates parameter to specify the presence of a file that means that the resource is already converged.

Local filename is a unique relative path within download and do download directory /var/cache/download_and_do.

Download, Run

include download_and_do
download_and_do::run { "test.sh":
  source => "http://blah/cut/spec/fixtures/test.sh"
}

Download from source to title, then make the local file executable and run it. Pass the creates parameter to specify the presence of a file that means that the resource is already converged.

Local filename is a unique relative path within download and do download directory /var/cache/download_and_do.

Limitations

  • Requires the puppet archive module
  • You may encounter errors with download_and_do::extract_and_run on windows due to shell quoting

Development

PRs accepted :)

Testing

This module supports testing using PDQTest.

Test can be executed with:

bundle install
bundle exec pdqtest all

See .travis.yml for a working CI example