GithubHelp home page GithubHelp logo

swisscom / puppet-package_verifiable Goto Github PK

View Code? Open in Web Editor NEW
2.0 18.0 3.0 61 KB

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.

License: MIT License

Ruby 75.80% Augeas 2.30% Puppet 17.38% Pascal 4.51%
puppet puppet-module package

puppet-package_verifiable's Introduction

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.