Forge Home

package_alternatives

Package wrapper for easy work with different package names across platforms

13,945 downloads

6,202 latest version

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

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

  • 1.0.3 (latest)
  • 1.0.2 (deleted)
  • 1.0.1 (deleted)
  • 1.0.0 (deleted)
  • 0.9.5
  • 0.9.4
  • 0.9.3
  • 0.9.2
  • 0.9.1
  • 0.9.0
released Apr 27th 2018
This version is compatible with:
  • Puppet Enterprise 2018.1.x, 2017.3.x, 2017.2.x, 2017.1.x, 2016.5.x, 2016.4.x
  • Puppet >= 4.7.0 < 6.0.0
  • RedHat, CentOS, Scientific, OracleLinux, Fedora, SLES, SLED, Debian, Ubuntu

Start using this module

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

Add this module to your Puppetfile:

mod 'ceritsc-package_alternatives', '1.0.3'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add ceritsc-package_alternatives
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install ceritsc-package_alternatives --version 1.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
Tags: package

Documentation

ceritsc/package_alternatives — version 1.0.3 Apr 27th 2018

Puppet package_alternatives module

This module provides a defined type package_alternatives for easy installation of software packages with different (alternative) names across platforms.

Requirements

Module has been tested on:

  • Puppet 5.5
  • Debian and Red Hat family systems

Required modules:

Quick Start

Full configuration options:

package_alternatives { 'resource title':
  ensure       => ...,         # Resource package ensure state
  fail_missing => boolean,     # Fail on no alternative package.
  alternatives => string|hash, # Structure with package alternatives.
  platform     => string,      # Current platform detection override.
}

Software alternatives structure

$alternatives accepts:

  • string for no alternative (defaults to resource $title)

  • hash of platforms and alternative package names, e.g.:

$software = {
  'debian' => 'openssh-client',
  'redhat' => 'openssh-clients'
}
  • hash of resource names with with hash or string containing package name or platforms hash of alternatives, e.g.:
$software = {
  'bash' => 'bash',
  'openssh-client' => {
    'debian' => 'openssh-client',
    'redhat' => 'openssh-clients',
  }
}

Platforms resolution order

Lower cased:

  1. Custom $platform parameter
  2. ${::operatingsystem}-${::operatingsystemrelease}-${::architecture} (centos-6.4-x86_64)
  3. ${::operatingsystem}-${::operatingsystemrelease} (centos-6.4)
  4. ${::operatingsystem}-${::operatingsystemmajrelease}-${::architecture} (centos-6-x86_64)
  5. ${::operatingsystem}-${::operatingsystemmajrelease} (centos-6)
  6. ${::operatingsystem}-${::architecture} (centos-x86_64)
  7. ${::operatingsystem} (centos)
  8. ${::osfamily}-${::operatingsystemrelease}-${::architecture} (redhat-6.4-x86_64)
  9. ${::osfamily}-${::operatingsystemrelease} (redhat-6.4)
  10. ${::osfamily}-${::operatingsystemmajrelease}-${::architecture} (redhat-6-x86_64)
  11. ${::osfamily}-${::operatingsystemmajrelease} (redhat-6)
  12. ${::osfamily}-${::architecture} (redhat-x86_64)
  13. ${::osfamily} (redhat)

Software alternatives structure

Parameter $alternatives accepts:

  • string for no alternative (defaults to resource $title)
$software = 'bash'
  • hash of platforms and alternative package names, e.g.:
$software = {
  'debian' => 'openssh-client',
  'redhat' => 'openssh-clients'
}
  • hash of resource names with with hash or string containing package name or platforms hash of alternatives, e.g.:
$software = {
  'bash' => 'bash',
  'openssh-client' => {
    'debian' => 'openssh-client',
    'redhat' => 'openssh-clients',
  }
}

Example

$software = {
  'rsync'  => 'rsync',          # same name on all platforms
  'ash'    => {
    'debian'   => 'ash'         # just Debian supported
  },
  'tshark' => {
    'debian-6' => 'tshark',     # just Debian 6 and any
    'redhat'   => 'wireshark',  # RedHat family supported
  },
}

package_alternatives { keys($software):
  ensure       => present,
  alternatives => $software,
  fail_missing => false,       # skip packages with no alternative on platform
}

CERIT Scientific Cloud, support@cerit-sc.cz