yum
: A class to install and manage Yum configuration.yum::clean
: A $(yum clean all) Exec to be notified if desired.yum::plugin::versionlock
: Class: yum::plugin::versionlock This class installs versionlock plugin Parameters: [ensure] - specifies if versionlock should be presen
yum::config
: Define: yum::config This definition manages yum.conf Parameters: [key] - alternative conf. key (defaults to name) [ensure] -yum::gpgkey
: Define: yum::gpgkey This definition saves and imports public GPG key for RPM. Key can be stored on Puppet's fileserver or as inline content.yum::group
: Define: yum::group This definition installs or removes yum package group. Parameters: [ensure] - specifies if package group should beyum::install
: Define: yum::install This definition installs or removes rpms from local file or URL via yum install command. This can be better than usingyum::plugin
: Define: yum::plugin This definition installs Yum plugin. Parameters: [ensure] - specifies if plugin should be present or absent Actiyum::versionlock
: Locks package from updates.
yum::bool2num_hash_recursive
: This functions converts the Boolean values of a Hash to Integers, either '0' or '1'. It does this recursively, decending as far as the langu
Yum::RpmArch
: Valid rpm architectures.Yum::RpmName
: Valid rpm name.Yum::RpmRelease
: Valid rpm release fields.Yum::RpmVersion
: Valid rpm version fields.Yum::VersionlockString
: This type matches strings appropriate for use with yum-versionlock. Its basic format, using therpm(8)
query string format, is `%{EPOCH}:%{
init
: Allows you to perform yum functions
A class to install and manage Yum configuration.
---
yum::manage_os_default_repos: true
---
yum::manage_os_default_repos: true
yum::repo_exclusions:
- 'base'
---
yum::manage_os_default_repos: true
yum::repos:
base:
ensure: 'absent'
---
yum::managed_repos:
- 'example_repo'
yum::repos:
example_repo:
ensure: 'present'
enabled: true
descr: 'Example Repo'
baseurl: 'https://repos.example.com/example/'
gpgcheck: true
gpgkey: 'file:///etc/pki/gpm-gpg/RPM-GPG-KEY-Example'
target: '/etc/yum.repos.d/example.repo'
---
yum::manage_os_default_repos: true
yum::repos:
base:
baseurl: 'https://repos.example.com/CentOS/base/'
mirrorlist: '--'
The following parameters are available in the yum
class.
Data type: Boolean
Whether or not to purge old kernel version beyond the keeponly_limit
.
Default value: true
Data type: Boolean
Whether or not to keep kernel devel packages on old kernel purge.
Default value: false
Data type: Hash[String, Variant[String, Integer, Boolean, Hash[String, Variant[String, Integer, Boolean]]]]
A Hash where keys are the names of Yum::Config
resources and the values
are either the direct ensure
value, or a Hash of the resource's attributes.
@note Boolean parameter values will be converted to either a 1
or 0
; use a quoted string to
get a literal true
or false
.
Default value: { }
Data type: Optional[Hash[String, Optional[Hash[String, Variant[String, Integer, Boolean]]]]]
A hash where keys are the names of Yumrepo
resources and each value represents its respective
Yumrepo's resource parameters. This is used in conjunction with the managed_repos
parameter
to create Yumrepo
resources en masse. Some default data is provided for this using module
data. It is configured to deep merge with a knockout_prefix
of --
by default, so individual
parameters may be overriden or removed via global or environment Hiera data.
@note Boolean parameter values will be converted to either a 1
or 0
; use a quoted string to
get a literal true
or false
.
Default value: {}
Data type: Array[String]
An array of first-level keys from the repos
hash to include in the catalog. The module uses
this list to select Yumrepo
resources from the repos
hash for instantiation. Defaults are
set in the module's Hiera data.
@note This only indicates the managed state of the repos, the ensure
state must be managed
in the repos
data.
Default value: []
Data type: Boolean
Whether or not to add an operating system's default repos to the managed_repos
array.
@note This only works for operating systems with data in the module's data directory. Currently the module only contains data for for CentOS 6 & 7.
Default value: false
Data type: Array[String]
A list of default repos to add to managed_repos
if manage_os_default_repos
is enabled.
Normally this should not be modified.
Default value: []
Data type: Array[String]
An array of first-level keys from the repos
hash to exclude from management via this module.
Values in this array will be subtracted from the managed_repos
array as a last step before
instantiation.
Default value: []
Data type: Hash[String, Hash[String, String]]
A hash of yum::gpgkey types, which will be automatically included if they are referenced by a managed_repo. This will use the same merging behavior as repos.
Default value: {}
Data type: String
Name of the utils package, e.g. 'yum-utils', or 'dnf-utils'.
Default value: 'yum-utils'
A $(yum clean all) Exec to be notified if desired.
Class: yum::plugin::versionlock
This class installs versionlock plugin
Parameters: [ensure] - specifies if versionlock should be present or absent [clean] - specifies if yum clean all should be called after edits. Defaults false.
Actions:
Requires:
Sample usage: include yum::plugin::versionlock
The following parameters are available in the yum::plugin::versionlock
class.
Data type: Enum['present', 'absent']
Default value: 'present'
Data type: String
Default value: '/etc/yum/pluginconf.d/versionlock.list'
Data type: Boolean
Default value: false
Define: yum::config
This definition manages yum.conf
Parameters: [key] - alternative conf. key (defaults to name) [ensure] - specifies value or absent keyword [section] - config section (default to main)
Actions:
Requires: RPM based system
Sample usage: yum::config { 'installonly_limit': ensure => 2, }
yum::config { 'debuglevel': ensure => absent, }
The following parameters are available in the yum::config
defined type.
Data type: Variant[Boolean, Integer, Enum['absent'], String]
Data type: String
Default value: $title
Define: yum::gpgkey
This definition saves and imports public GPG key for RPM. Key can be stored on Puppet's fileserver or as inline content. Key can be also removed from system.
Parameters: [path] - alternative file location (defaults to name) [ensure] - specifies if key should be present or absent [content] - content [source] - source (e.g.: puppet:///) [owner] - file owner [group] - file group [mode] - file mode
Actions:
Requires: RPM based system
Sample usage: yum::gpgkey { '/etc/pki/rpm-gpg/RPM-GPG-KEY-puppet-smoketest1': ensure => 'present', content => '-----BEGIN PGP PUBLIC KEY BLOCK----- ... -----END PGP PUBLIC KEY BLOCK-----'; }
The following parameters are available in the yum::gpgkey
defined type.
Data type: String
Default value: $name
Data type: Enum['present', 'absent']
Default value: 'present'
Data type: Optional[String]
Default value: undef
Data type: Optional[String]
Default value: undef
Data type: String
Default value: 'root'
Data type: String
Default value: 'root'
Data type: String
Default value: '0644'
Define: yum::group
This definition installs or removes yum package group.
Parameters: [ensure] - specifies if package group should be present (installed) or absent (purged) [timeout] - exec timeout for yum groupinstall command [install_options] - options provided to yum groupinstall command
Actions:
Requires: RPM based system
Sample usage: yum::group { 'X Window System': ensure => 'present', }
The following parameters are available in the yum::group
defined type.
Data type: Array[String[1]]
Default value: []
Data type: Enum['present', 'installed', 'latest', 'absent', 'purged']
Default value: 'present'
Data type: Optional[Integer]
Default value: undef
Define: yum::install
This definition installs or removes rpms from local file or URL via yum install command. This can be better than using just the rpm provider because it will pull all the dependencies.
Parameters: [ensure] - specifies if package group should be present (installed) or absent (purged) [source] - file or URL where RPM is available
Actions:
Requires: RPM based system
Sample usage: yum::install { 'epel-release': ensure => 'present', source => 'https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm', }
The following parameters are available in the yum::install
defined type.
Data type: String
Data type: Enum['present', 'installed', 'absent', 'purged']
Default value: 'present'
Data type: Optional[Integer]
Default value: undef
Define: yum::plugin
This definition installs Yum plugin.
Parameters: [ensure] - specifies if plugin should be present or absent
Actions:
Requires: RPM based system
Sample usage: yum::plugin { 'versionlock': ensure => 'present', }
The following parameters are available in the yum::plugin
defined type.
Data type: Enum['present', 'absent']
Default value: 'present'
Data type: Optional[String]
Default value: undef
Data type: Optional[String]
Default value: undef
Locks package from updates.
-
Note The resource title must use the format By default on CentOS 7 the following format is used. "%{EPOCH}:%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}". This can be retrieved via the command `rpm -q --qf '%{EPOCH}:%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}'. If "%{EPOCH}" returns as '(none)', it should be set to '0'. Wildcards may be used within token slots, but must not cover seperators, e.g., '0:bsh-4.1.2-9.' covers Bash version 4.1.2, revision 9 on all architectures. By default on CentOS 8 and newer the resource title to just set the package name. If a version is set on CentOS 7 then it behaves like CentOS 8
-
See also
yum::versionlock { '0:bash-4.1.2-9.el7.*':
ensure => present,
}
yum::versionlock { 'bash':
ensure => present,
version => '4.1.2',
release => '9.el8',
epoch => '0',
arch => 'noarch',
}
yum::versionlock { 'bash':
ensure => present,
version => '3.1.2',
release => '9.el7',
epoch => '0',
arch => 'noarch',
}
The following parameters are available in the yum::versionlock
defined type.
Data type: Enum['present', 'absent', 'exclude']
Specifies if versionlock should be present
, absent
or exclude
.
Default value: 'present'
Data type: Optional[Yum::RpmVersion]
Version of the package if CentOS 8 mechanism is used. This must be set for dnf based systems (e.g CentOS 8). If version is set then the name var is assumed to a package name and not the full versionlock string.
Default value: undef
Data type: Yum::RpmRelease
Release of the package if CentOS 8 mechanism is used.
Default value: '*'
Data type: Variant[Yum::RpmArch, Enum['*']]
Arch of the package if CentOS 8 mechanism is used.
Default value: '*'
Data type: Integer[0]
Epoch of the package if CentOS 8 mechanism is used.
Default value: 0
Type: Puppet Language
This functions converts the Boolean values of a Hash to Integers, either '0' or '1'. It does this recursively, decending as far as the language implemenation will allow. Note that Structs and Arrays will be ignored, even if they contain Hashes.
Hash $foo = {
bar => { 'a' => true, 'b' => 'b' },
baz => false,
qux => [{ 'c' => true }, { 'd' => false }],
}
yum::bool2num_hash_recursive($foo)
The above would return:
{
bar => { 'a' => 1, 'b' => 'b' },
baz => 0,
qux => [{ 'c' => true }, { 'd' => false }],
}
This functions converts the Boolean values of a Hash to Integers, either '0' or '1'. It does this recursively, decending as far as the language implemenation will allow. Note that Structs and Arrays will be ignored, even if they contain Hashes.
Returns: Hash
Hash $foo = {
bar => { 'a' => true, 'b' => 'b' },
baz => false,
qux => [{ 'c' => true }, { 'd' => false }],
}
yum::bool2num_hash_recursive($foo)
The above would return:
{
bar => { 'a' => 1, 'b' => 'b' },
baz => 0,
qux => [{ 'c' => true }, { 'd' => false }],
}
Data type: Hash
The hash on which to operate
Output of rpm -q --queryformat '%{arch}\n' package
Alias of Enum['noarch', 'x86_64', 'i386', 'arm', 'ppc64', 'ppc64le', 'sparc64', 'ia64', 'alpha', 'ip', 'm68k', 'mips', 'mipsel', 'mk68k', 'mint', 'ppc', 'rs6000', 's390', 's390x', 'sh', 'sparc', 'xtensa']
Can be alphanumeric or contain .
_
+
%
{
}
-
.
Output of rpm -q --queryformat '%{name}\n package
Examples python36-foobar, netscape
Alias of Pattern[/\A([0-9a-zA-Z\._\+%\{\}-]+)\z/]
It may not contain a dash.
Output of rpm -q --queryformat '%{release}\n' package
.
Examples 3.4 3.4.el6, 3.4.el6_2
Alias of Pattern[/\A([^-]+)\z/]
It may not contain a dash.
Output of rpm -q --queryformat '%{version}\n' package
.
Examples 3.4, 2.5.alpha6
Alias of Pattern[/\A([^-]+)\z/]
This type matches strings appropriate for use with yum-versionlock.
Its basic format, using the rpm(8)
query string format, is
%{EPOCH}:%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}
. As a Regex, it
breaks down into five distinct parts, plus the seperators.
EPOCH: An unsigned integer type Yum::PackageEpoch = Regexp[/[0-9]*]+/]
NAME: Any valid package name (see https://github.com/rpm-software-management/rpm/blob/master/doc/manual/spec) type Yum::PackageName = Regexp[/[0-9a-zA-Z._+%{}*-]+/]
VERSION: Any valid version string. The only limitation here, according to the RPM manual, is that it may not contain a dash (-
).
type Yum::PackageVersion = Regexp[/[^-]+/]
RELEASE: Any valid release string. Only limitation is that it is not a dash (-
)
type Yum::PackageRelease = Regexp[/[^-]+/]
ARCH: Matches a string such as el7.x86_64
. This is actuall two sub-expressions. See below.
type Yum::PackageArch = Regexp[/([0-9a-zZ-Z_*]+)(?:.(noarch|x86_64|i386|arm|ppc64|ppc64le|sparc64|ia64|alpha|ip|m68k|mips|mipsel|mk68k|mint|ppc|rs6000|s390|s390x|sh|sparc|xtensa|*))?/]
The %{ARCH}
sub-expression is composed of two sub-expressions
separated by a dot (.
), where the second part is optional. The RPM
specification calls the first field the DistTag
, and the second the
BuildArch
.
DistTag: Any string consiting of only letters, numbers, or an underscore, e.g., el6
, sl7
, or fc24
.
type Yum::PackageDistTag = Regexp[/[0-9a-zZ-Z_*]+/]
BuildArch: Any string from the list at https://github.com/rpm-software-management/rpm/blob/master/rpmrc.in. Strings are roughly listed from most common to least common to improve performance. type Yum::PackageBuildArch = Regexp[/noarch|x86_64|i386|arm|ppc64|ppc64le|sparc64|ia64|alpha|ip|m68k|mips|mipsel|mk68k|mint|ppc|rs6000|s390|s390x|sh|sparc|xtensa/]
wildcard characters may not span the fields, may not cover the seperators. This is an undocumented but tested limitation of yum-versionlock.
- Note Each field may contain wildcard characters (
*
), but the
Alias of Pattern[/^([0-9\*]+):([0-9a-zA-Z\._\+%\{\}\*-]+)-([^-]+)-([^-]+)\.(([0-9a-zZ-Z_\*]+)(?:\.(noarch|x86_64|i386|arm|ppc64|ppc64le|sparc64|ia64|alpha|ip|m68k|mips|mipsel|mk68k|mint|ppc|rs6000|s390|s390x|sh|sparc|xtensa|\*))?)$/]
Allows you to perform yum functions
Supports noop? false
Data type: Enum[update, upgrade, 'list updates']
Action to perform
Data type: Optional[Boolean]
Run without output