Version information
This version is compatible with:
- Puppet Enterprise 2023.8.x, 2023.7.x, 2023.6.x, 2023.5.x, 2023.4.x, 2023.3.x, 2023.2.x, 2023.1.x, 2023.0.x, 2021.7.x, 2021.6.x, 2021.5.x, 2021.4.x, 2021.3.x, 2021.2.x, 2021.1.x, 2021.0.x
- Puppet >= 7.0.0 < 9.0.0
- , , , ,
Start using this module
Add this module to your Puppetfile:
mod 'treydock-yum_cron', '7.1.0'
Learn more about managing modules with a PuppetfileDocumentation
puppet-yum_cron
Table of Contents
- Overview - What is the yum_cron module?
- Backwards Compatibility - Key changes between versions
- Usage - Configuration and customization options
- Reference - Parameter and detailed reference to all options
- Compatibility - Operating system and Puppet compatibility
Overview
The yum_cron module manages either the yum-cron or dnf-automatic (RHEL/CentOS 8+) package to allow for automatic updates and available updates notifications.
Backwards Compatibility
Version 3.x of this module modified the way apply_updates
and download_updates
parameters are handled. apply_updates
now takes precedence over download_updates
. If apply_updates
is true
then download_updates
has no effect.
Version 2.x of this module added and removed many parameters. See CHANGELOG for detailed list of all the changes.
Version 1.x of this module replaced the disable_yum_autoupdate and remove_yum_autoupdate parameters with yum_autoupdate_ensure. The default behavior is still to disable yum-autoupdate.
Usage
Class: yum_cron
The default parameters will install and enable yum-cron to only check for updates and notify root if any are available. Generally, dnf-automatic uses different paths, but functions very similarly and has a similar config file. For the rest of the documentation, you can generally assuming that references to yum-cron also apply to dnf-automatic.
On Scientific Linux the default behavior is also to disable yum-autoupdate.
class { 'yum_cron': }
These are the actions taken by the module with default parameter values:
- Install yum-cron/dnf-automatic
- Set configuration values to enable checking for updates and notify root
- Start and enable the yum-cron/dnf-automatic service
- Disable yum-autoupdate by setting ENABLED="false" in /etc/sysconfig/yum-autoupdate (Scientific Linux only)
This is an example of enabling automatic updates
class { 'yum_cron':
apply_updates => true,
}
Refer to the yum-cron manpage for all available configuration options.
Additional configuration values can be passed to the yum-cron
configurations via the extra_configs
parameter.
To define additional configuration options for EL6:
class { 'yum_cron':
extra_configs => {
'yum_cron ERROR_LEVEL' => { 'variable' => 'ERROR_LEVEL', 'value' => '1' }
}
}
To define additional configuration options for EL7:
class { 'yum_cron':
extra_configs => {
'email/email_from' => { 'value' => 'foo@bar.com' }
}
}
Reference
http://treydock.github.io/puppet-yum_cron/
Compatibility
This module should be compatible with all RedHat based operating systems and Puppet 7 and newer.
It has only been tested on:
- RHEL and RHEL derivatives 7, 8, 9
- Amazon Linux 2, 2022, 2023
Reference
Table of Contents
Classes
Public Classes
yum_cron
: Manage yum-cron
Private Classes
yum_cron::config
: Manage yum-cron configsyum_cron::install
: Install yum-cronyum_cron::service
: Manage yum-cron service
Resource types
dnf_automatic_config
: Section/setting name to manage from dnf-automatic.confyum_cron_config
: Section/setting name to manage from yum-cron.confyum_cron_hourly_config
: Section/setting name to manage from yum-cron-hourly.conf
Data types
Yum_cron::Update_cmd
: yum-cron update cmd
Classes
yum_cron
Manage yum-cron
Parameters
The following parameters are available in the yum_cron
class:
ensure
enable
download_updates
apply_updates
upgrade_type
debug_level
exclude_packages
randomwait
mailto
systemname
email_host
update_cmd
update_messages
extra_configs
extra_hourly_configs
yum_autoupdate_ensure
package_ensure
package_name
service_name
service_ensure
service_enable
service_hasstatus
service_hasrestart
config_path
ensure
Data type: Enum['present', 'absent']
Defines the presence of yum-cron
.
Default value: 'present'
enable
Data type: Boolean
Boolean that defines the state of yum-cron
.
Default value: true
download_updates
Data type: Boolean
Boolean that determines if updates should be automatically downloaded.
Default value: true
apply_updates
Data type: Boolean
Boolean that determines if updates should be automatically installed.
If set to true
then download_updates
ignored.
Default value: false
upgrade_type
Data type: Enum['default','security']
The kind of updates to perform. Applies only to EL8, EL9.
Default value: 'default'
debug_level
Data type: Pattern[/^(?:-)?[0-9]$/]
Sets debug level.
Default value: '-2'
exclude_packages
Data type: Array
Packages to exclude from updates.
Default value: []
randomwait
Data type: Pattern[/^[0-9]+$/]
Sets random wait time.
Default value: '360'
mailto
Data type: String
Address notified about updates.
Default value: 'root'
systemname
Data type: String
Name of system used in notifications.
Default value: $facts['networking']['fqdn']
email_host
Data type: String
Host used to send email messages.
Default value: 'localhost'
update_cmd
Data type: Yum_cron::Update_cmd
The kind of updates to use. Applies only to EL7. Valid values:
- default = yum upgrade
- security = yum --security upgrade
- security-severity:Critical = yum --sec-severity=Critical upgrade
- minimal = yum --bugfix upgrade-minimal
- minimal-security = yum --security upgrade-minimal
- minimal-security-severity:Critical = --sec-severity=Critical upgrade-minimal
Default value: 'default'
update_messages
Data type: Enum['yes','no']
Determines whether a message should be emitted when updates are available, downloaded, and applied. Applies only to EL7.
Default value: 'yes'
extra_configs
Data type: Hash
Hash that can be used to define additional configurations. Applies only to EL7, EL8, and EL9.
For EL8 and EL9 the hash defines additonal dnf_automatic_config
resources.
For EL7 the hash defines additional yum_cron_config
resources.
Default value: {}
extra_hourly_configs
Data type: Hash
Hash that can be used to define additional hourly configurations. Applies only to EL7.
For EL7 the hash defines additional yum_cron_hourly_config
resources.
Default value: {}
yum_autoupdate_ensure
Data type: Enum['undef', 'UNSET', 'absent', 'disabled']
Defines how to handle yum-autoupdate on Scientific Linux systems. Applies only to Scientific Linux. Valid values:
- 'disabled' (default) - Sets ENABLED='false' in /etc/sysconfig/yum-autoupdate.
- 'absent' - Uninstall the yum-autoupdate package.
- 'undef' or 'UNSET' - Leave yum-autoupdate unmanaged.
Default value: 'disabled'
package_ensure
Data type: Optional[String]
The ensure value passed to yum-cron package resource.
When undef
, the value passed to the package resources is based on this class' ensure
parameter value.
Default value: undef
package_name
Data type: String
yum-cron package name. Default is based on OS version.
service_name
Data type: String
yum-cron service name. Default is based on OS version.
service_ensure
Data type: Optional[String]
The ensure value passed to yum-cron service resource.
When undef
, the value passed to the service resources is based on this class' ensure
and enable
parameter values.
Default value: undef
service_enable
Data type: Optional[Boolean]
The ensure value passed to yum-cron package resource.
When undef
, the value passed to the service resources is based on this class' ensure
and enable
parameter values.
Default value: undef
service_hasstatus
Data type: Boolean
Service hasstatus property.
Default value: true
service_hasrestart
Data type: Boolean
Service hasrestart property.
Default value: true
config_path
Data type: Stdlib::Absolutepath
Path to yum-cron configuration. Default is based on OS version.
Resource types
dnf_automatic_config
Section/setting name to manage from dnf-automatic.conf
Properties
The following properties are available in the dnf_automatic_config
type.
ensure
Valid values: present
, absent
The basic property that the resource should be in.
Default value: present
value
The value of the setting to be defined.
Parameters
The following parameters are available in the dnf_automatic_config
type.
name
namevar
Section/setting name to manage from dnf-automatic.conf
provider
The specific backend to use for this dnf_automatic_config
resource. You will seldom need to specify this --- Puppet
will usually discover the appropriate provider for your platform.
yum_cron_config
Section/setting name to manage from yum-cron.conf
Properties
The following properties are available in the yum_cron_config
type.
ensure
Valid values: present
, absent
The basic property that the resource should be in.
Default value: present
value
The value of the setting to be defined.
Parameters
The following parameters are available in the yum_cron_config
type.
name
namevar
Section/setting name to manage from yum-cron.conf
provider
The specific backend to use for this yum_cron_config
resource. You will seldom need to specify this --- Puppet will
usually discover the appropriate provider for your platform.
yum_cron_hourly_config
Section/setting name to manage from yum-cron-hourly.conf
Properties
The following properties are available in the yum_cron_hourly_config
type.
ensure
Valid values: present
, absent
The basic property that the resource should be in.
Default value: present
value
The value of the setting to be defined.
Parameters
The following parameters are available in the yum_cron_hourly_config
type.
name
namevar
Section/setting name to manage from yum-cron-hourly.conf
provider
The specific backend to use for this yum_cron_hourly_config
resource. You will seldom need to specify this --- Puppet
will usually discover the appropriate provider for your platform.
Data types
Yum_cron::Update_cmd
yum-cron update cmd
Alias of Enum['default', 'security', 'security-severity:Critical', 'minimal', 'minimal-security', 'minimal-security-severity:Critical']
Change log
All notable changes to this project will be documented in this file. The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
v7.1.0 (2023-11-16)
Added
v7.0.0 (2023-05-03)
Changed
Added
v6.2.0 (2022-06-16)
Added
v6.1.0 (2021-09-14)
Added
v6.0.0 (2021-03-26)
Changed
Added
- Numerous improvements to module code #36 (treydock)
- Add exclude_packages parameter #35 (treydock)
- Add upgrade_type parameter for EL8, EL8 improvements #34 (treydock)
v5.1.0 (2019-10-07)
Added
- Increase upper bound for supported stdlib #29 (treydock)
- EL8 support #28 (treydock)
- RHEL8 Support (for dnf-automatic) #26 (jadestorm)
Fixed
v5.0.0 (2019-08-09)
Changed
Added
- Convert module to use PDK #24 (treydock)
- Allow management of /etc/yum/yum-cron-hourly.conf #23 (treydock)
4.1.1 (2019-04-29)
Added
4.1.0 (2019-01-30)
Added
- raise upper version bounds for recent dependencies #17 (mmoll)
- update beaker to 4.x #16 (mmoll)
- Fix hiera example of update_messages #15 (yorickps)
4.0.0 (2018-02-13)
3.0.0 (2018-02-10)
Fixed
2.0.0 (2015-11-12)
1.3.0 (2015-10-06)
Added
- Support for CentOS 7 #5 (narbutas)
- Parametrize option email_host. #4 (moonwolf-github)
1.2.0 (2015-03-02)
1.1.1 (2014-11-07)
1.1.0 (2014-11-03)
1.0.0 (2013-12-12)
0.1.1 (2013-12-09)
0.1.0 (2013-09-18)
v0.0.1 (2013-09-04)
* This Changelog was automatically generated by github_changelog_generator
Dependencies
- puppetlabs/stdlib (>= 4.13.1 <10.0.0)
- puppetlabs/inifile (>= 1.0.0 <7.0.0)
Copyright (C) 2014 Trey Dockendorf <treydock@gmail.com> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.