Forge Home

package_verifiable

Make package version available in the catalog.

6,646 downloads

6,646 latest version

4.5 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

  • 2.0.1 (latest)
released Jul 7th 2016
This version is compatible with:
  • ,

Start using this module

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

Add this module to your Puppetfile:

mod 'swisscom-package_verifiable', '2.0.1'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add swisscom-package_verifiable
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install swisscom-package_verifiable --version 2.0.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

swisscom/package_verifiable — version 2.0.1 Jul 7th 2016

package_verifiable

Build Status

This is the package_verifiable module.

The idea is that we have a way to check within the catalog whether a package currently installed matches the one we want to install.

For that we place a custom fact that records the installed version and then we can use a function to verify whether there will be a change.

Usage

$pkg_version = hiera('some_package_version','1.0-1')
package_verifiable{
  'some-package':
    version => $pkg_version,
}

# $::package_some_package_version is undef if the package is not yet installed
if $::package_some_package_version and !verify_package_versions('some-package',$pkg_version) {
  exec{'systemctl stop some-service && rm -rf /opt/my_package/service':
    before => Package['some-package'],
  }
}

If the current deployed package does not match the version on the system the exec will be included into the catalog and hence triggered. By playing with before/require you will be able to add pre-/post-hooks to the package management.

If the package itself is managed in another module that should not be using the package module, we can simply add the wrapper here, without managing the package itself:

$pkg_version = hiera('some_package_version','1.0-1')
package_verifiable{
  'some-package':
    version        => $pkg_version,
    manage_package => false,
}

Support

Please log tickets and issues at our Projects site

MIT license, see LICENSE.md