Forge Home

deploy

Puppet module to deploy tar files

1,716,331 downloads

1,713,968 latest version

4.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.

Version information

  • 0.0.3 (latest)
  • 0.0.2
  • 0.0.1
released Aug 31st 2014

Start using this module

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

Add this module to your Puppetfile:

mod 'mkrakowitzer-deploy', '0.0.3'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add mkrakowitzer-deploy
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install mkrakowitzer-deploy --version 0.0.3

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

mkrakowitzer/deploy — version 0.0.3 Aug 31st 2014

#puppet-deploy Build
Status ##Overview

This module downloads and extracts compressed files to a specific directory.

The following archives are supported:

  • .tar.gz
  • .tgz
  • .tar.bz2
  • .tar.xz

###Setup Requirements

##Usage

    # Set the default temp directory to use
    class { 'deploy':
      tempdir => '/opt/deploy'
    }

    # Deploy Java tar file
    deploy::file { 'jdk-7u21-linux-x64.tar.gz':
      target  => '/opt/development-tools/java/jdk1.7.0_21',
      url     => 'http://mywebsite.co.za/development-tools/java',
      strip   => true,
    }
  
    # Deploy another tar file
    deploy::file { 'jdk-8-ea-bin-b90-linux-x64-16_may_2013.tar.gz':
      target  => '/opt/development-tools/java/jdk1.8.0_b90',
      url     => 'http://server.co.za/development-tools/java/',
      strip   => true,
    }

    deploy::file { 'apache-maven-3.0.5-bin.tar.gz':
      target  => '/opt/development-tools/apache-maven',
      url     => 'http://server/pub/apache-maven/',
      strip   => true
      version => '1',
      package => 'maven'
    }

###Classes:

  • deploy - set the default working directory.

###Definitions:

  • deploy::file - Deploy a compressed file to a target directory.

Common Parameters

target

  • The target directory to decompress the archive file too.
  • This parameter is required

url

  • The URL where the file can be downloaded from.
  • This parameter is required. Do no specify the file name in the URL.
  • For testing purpose, the module can handle URLs in from file:///... and puppet:///... style. You must not specify the file name with this URLs either.

owner

  • Define which user will owner deployed files. You need to declare this user.

group

  • Define which group will owner deployed files. You need to declare this group.
  • Defaults to undefined

strip

  • Strip root directory from archive file
  • Defaults to 'false'

strip_level

  • Levels to strip from root directory from archive file
  • Defaults to '1'

version

  • Define an arbitrary version number for the tar file. Must be an integer.
  • WARNING: Incrementing this version number removes target directory and and redeploys tar file. Both version and package must be defined.
  • Defaults to undefined

package

  • define an arbitrary package name for the tar file.
  • creates a static fact [package]_version in /etc/facter/facts.d/ with file name [package].yaml. Both version and package must be defined.
  • Defaults to undefined
  • requires facter 1.7.x
  • requires the /etc/facter/facts.d/ directory structure to be in place.

If you decide to use the version and package parameters you get to keep both pieces if it breaks. I certainly don't recommend managing packages this way.

##Limitations

  • I'm sure there are many

###Supported Operating Systems:

  • Ubuntu (12.04 LTS tested)
  • Red Hat family (RHEL 5 and 6 tested)

##Testing Using puppetlabs_spec_helper. Simply run:

bundle install && bundle exec rake spec

to get results.

/usr/bin/ruby1.9.1 -S rspec spec/defines/deploy_files_spec.rb --color
ldapname is deprecated and will be removed in a future version
.

Finished in 0.16558 seconds
1 example, 0 failures

##Development

  • Copyright (C) 2013 Merritt Krakowitzer - merritt@krakowitzer.com
  • Distributed under the terms of the Apache License, Version 2.0.
  • Please submit a pull request or issue on GitHub

Contributors

  • Jonathan Johnson
  • Andreyev Dias de Melo