Forge Home

artifact

Download and update artifacts

12,919 downloads

7,702 latest version

3.1 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

  • 0.3.2 (latest)
  • 0.3.1
  • 0.3.0
  • 0.2.8
  • 0.2.7 (deleted)
  • 0.2.6
  • 0.2.5 (deleted)
  • 0.2.4 (deleted)
  • 0.2.3 (deleted)
  • 0.2.2 (deleted)
  • 0.2.1 (deleted)
  • 0.2.0 (deleted)
  • 0.1.4
  • 0.1.3
  • 0.1.2 (deleted)
  • 0.1.1
  • 0.1.0
released Apr 5th 2016
This version is compatible with:
  • Puppet >=2.7.20 <4.0.0
  • , , , , ,

Start using this module

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

Add this module to your Puppetfile:

mod 'swizzley88-artifact', '0.3.2'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add swizzley88-artifact
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install swizzley88-artifact --version 0.3.2

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

swizzley88/artifact — version 0.3.2 Apr 5th 2016

artifact

Puppet Forge

Table of Contents

  1. Overview
  2. Setup
  3. Parameteres
  4. Usage
  5. Requirements
  6. Compatibility
  7. Limitations
  8. Development

Overviw

This module is designed to download artifacts using curl, the key feature is the ability to update artifacts from a source if they are different. It uses curl because it doesn't usually need installed. For refreshing services dependant on these artifacts... which is why this module was developed relies heavily on meta parameters, require, subscribe, before, notify, and for triggering external checks the exec refreshonly bool. As of version 0.2.x this module adds a new bash script called /usr/local/sbin/artifact-puppet, this bash script is more efficient and reliable because it does a test based on file size before downloading, and then confirms the size matches before overriding the working file with the swap file, else it prints a download error, or skips the download entirely which only applies to the update => true parameter.

Setup

puppet module install swizzley88-artifact

Paramaeters

  • $source https://some_url.jar [required]
  • $target /some/local/dir [required]
  • $update override with newer [default: false]
  • $rename rename the downloaded file [default: undef]
  • $purge replace the target (alternative to updating) [default: false]
  • $swap /download/dir [default: /tmp]
  • $timeout exit after $x seconds [default: 0]
  • $owner uid owner of file [default: undef]
  • $group gid owner of file [default: undef]
  • $mode default permissions mode of file [default: undef]

Usage

artifact { 'artifact.war': 
  source   => 'http://example.com/pub/artifact.war', 
  target   => '/home/tomcat/webapps', 
  swap     => '/home/tomcat/tmp',
  purge    => true,
  update   => false,
  timeoute => 60,
  owner    => 'tomcat',
  group    => 'tomcat',
  mode     => '0640',
  before   => File['/home/tomcat/conf/artifact.properties'],
  notify   => Service['tomcat'],
}
artifact { "artifact-${version}-${build}.war": 
  source  => "http://example.com/pub/artifact-${version}-${build}.war", 
  target  => '/home/tomcat/webapps', 
  update  => true,
}

Command-Line usage of /usr/local/sbin/artifact-puppet:

/usr/local/sbin/artifact-puppet /opt/wordpress.tar.gz https://wordpress.org/latest.tar.gz /tmp/wordpress.tar.gz

This will only compare if ARG1's size isn't the same as ARG2 and download it to ARG3, it only touches ARG1 & ARG3 if they don't exist.

Requirements

package { ['curl', 'diffutils', 'grep', 'dos2unix']: ensure => 'installed' }

Compatibility

Linux:

  • RHEL/CentOS/Fedora/Oracle/Scientific
  • Debian/Ubuntu

Tested On: CentOS 6, Ubuntu 14.04

Limitations

Comparison operations are limited to diff for version <= 0.1.x, and to file size as of >= 0.2.x <= 0.3.0

WARNING: As of >= 0.2.8 File permissions are declared in this module, so the users declaring those permissions externally should use version <= 0.1.4

WARNING: Resume functionality in 0.2.6 can lead to corruption for artifacts that change before an interrupted download resumes, resume now deprecated as of >= 0.2.7

WARNING: As of >=0.3.0 the legacy update parameter has been deprecated, if using legacy => anywhere, stick to version >= 0.2.0 <= 0.2.8

Development

  • Add support for checksum params
  • Perhaps add additional OS support