package_alternatives
Package wrapper for easy work with different package names across platforms
Version information
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
Add this module to your Puppetfile:
mod 'ceritsc-package_alternatives', '1.0.3'
Learn more about managing modules with a PuppetfileDocumentation
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:
- Custom
$platform
parameter ${::operatingsystem}-${::operatingsystemrelease}-${::architecture}
(centos-6.4-x86_64)${::operatingsystem}-${::operatingsystemrelease}
(centos-6.4)${::operatingsystem}-${::operatingsystemmajrelease}-${::architecture}
(centos-6-x86_64)${::operatingsystem}-${::operatingsystemmajrelease}
(centos-6)${::operatingsystem}-${::architecture}
(centos-x86_64)${::operatingsystem}
(centos)${::osfamily}-${::operatingsystemrelease}-${::architecture}
(redhat-6.4-x86_64)${::osfamily}-${::operatingsystemrelease}
(redhat-6.4)${::osfamily}-${::operatingsystemmajrelease}-${::architecture}
(redhat-6-x86_64)${::osfamily}-${::operatingsystemmajrelease}
(redhat-6)${::osfamily}-${::architecture}
(redhat-x86_64)${::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
2018-04-28 - Release 1.0.3
- Fix support for hash of hashes with alternatives
- Fix module archive file permissions
2018-04-28 - Release 1.0.0
- Convert to the PDK module
- Modernize for Puppet 4/5
- Unit tests
2017-06-13 - Release 0.9.5
Fix warnings about Puppet Unknown variable: '_pkg_name'
2017-06-12 - Release 0.9.4
Check for already defined package alias.
2015-09-22 - Release 0.9.3
Check for already defined package.
Bugfixes
- Before defining new package check for existing definition.
2014-12-08 - Release 0.9.2
Fix file/directory permissions.
Bugfixes
- Fix PF module archive file/directory permissions.
2014-09-02 - Release 0.9.1
Summary
Fix metadata.json
Bugfixes
- Fix metadata.json module dependencies
2014-08-07 - Release 0.9.0
Summary
Initial release.
Dependencies
- puppetlabs/stdlib (>= 4.16.0 < 5.0.0)
The MIT License (MIT) Copyright (c) 2014-2017 CERIT-SC, Institute of Computer Science, Masaryk University Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.