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. | Read-only mirror of https://github.com/swisscom/puppet-package_verifiable — Swisscom. Issues & pull requests at the source.
  • Ruby 75.8%
  • Puppet 17.4%
  • Pascal 4.5%
  • Augeas 2.3%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Christian Schefuss 5986829389
Update README.md
2024-10-14 10:36:13 +02:00
lib move custom augeas lens to lib/augeas folder 2018-01-31 14:20:43 +01:00
manifests Add a header to each class/define. 2020-06-18 09:47:33 +02:00
spec Add support for RHEL8 2019-09-11 14:21:44 +02:00
.fixtures.yml Add starting '---' to yml. 2020-06-18 08:26:52 +02:00
.gitignore modulesync: update Gemfile, Rakefile, .gitignore and spec_helper.rb 2018-01-31 12:47:05 +01:00
.travis.yml Add starting '---' to yml. 2020-06-18 08:26:52 +02:00
CHANGELOG.md Add support for RHEL8 2019-09-11 14:21:44 +02:00
Gemfile Fix CI jobs 2019-05-08 14:26:35 +02:00
LICENSE.md add license 2016-07-05 14:31:40 +02:00
metadata.json Add support for RHEL8 2019-09-11 14:21:44 +02:00
Rakefile disable 140chars check 2018-03-05 16:06:03 +01:00
README.md Update README.md 2024-10-14 10:36:13 +02:00

Note

DEPRECATED - no longer maintained!

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.

Table of contents

  1. Parameters
  2. Usage
  3. Support

Parameters

Main class (package_verifiable)

package_verifiable::version (Optional)

  • Description: Set the package version
  • Type: String
  • Default value: installed

package_verifiable::epoch (Optional)

  • Description: Set the package epoch
  • Type: String
  • Default value:

package_verifiable::manage_package (Optional)

  • Description: Wether to ensure the package version with Puppet
  • Type: Boolean
  • Default value: true

package_verifiable::manage_dependency (Optional)

  • Description: Wether to manage the package dependencies too
  • Type: Boolean
  • Default value: true

Yum versionlock class (package_verifiable::yum::versionlock)

package_verifiable::yum::versionlock::ensure (Mandatory)

  • Description: Wether to ensure the versionlock or not
  • Type: String
  • Default value: n/a

package_verifiable::yum::versionlock::epoch (Optional)

  • Description: Package epoch to ensure
  • Type: String
  • Default value:

Usage

$pkg_version = lookup('some_package_version','1.0-1')

package_verifiable {'some-package':
  version => $pkg_version,
}

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. Note: The fact is undef if the package is not yet installed.

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 = lookup('some_package_version','1.0-1')

package_verifiable {'some-package':
  version        => $pkg_version,
  manage_package => false,
}

You can manage multiple packages if they share the same version.

$packages = ['myapp', 'myapp-common', 'myapp-libs']

package_verifiable {$packages:
  version => $pkg_version,
}

Support

Please log tickets and issues at our Projects site

MIT license, see LICENSE.md