yum_autoupdate
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, 2019.8.x, 2019.7.x, 2019.5.x, 2019.4.x, 2019.3.x, 2019.2.x, 2019.1.x, 2019.0.x, 2018.1.x, 2017.3.x, 2017.2.x, 2017.1.x, 2016.5.x, 2016.4.x
- Puppet >= 2.7.0
- , , , ,
Start using this module
Add this module to your Puppetfile:
mod 'aco-yum_autoupdate', '0.6.4'
Learn more about managing modules with a PuppetfileDocumentation
yum_autoupdate
Table of Contents
- Overview - What is the yum_autoupdate module?
- Module Description - What does the module do?
- Setup - The basics of getting started with yum_autoupdate
- To Do - List of features to be implemented
- Testing - How to run the included spec tests
- Contributors
Overview
The yum_autoupdate module allows you to configure automatic updates on all RHEL variants including Fedora.
Module description
The yum-cron service enables scheduled system updates on RHEL-based systems. This module allows you to install and configure this service without the need to fiddle manually with configuration files, which may vary from one major version to the other on most RHEL-based distributions.
Setup
yum_autoupdate will affect the following parts of your system:
- yum-cron package and service
- yum cron configuration file(s)
- yum-cron script on older distributions
Including the main class is enough to get started. It will enable automatic updates check via a cron.daily task and apply all available updates whenever possible. Summary emails are sent to the local root user.
include ::yum_autoupdate
A couple of examples
Disable emails and just download updates, do not apply
class { '::yum_autoupdate':
notify_email => false,
action => 'download'
}
Suppress debug output completely, but keep logging possible errors
class { '::yum_autoupdate':
…
debug_level => -1,
error_level => 3
}
Send emails to a different receiver (local root account by default) and from a specific sender address
class { '::yum_autoupdate':
…
email_to => 'admin@example.com',
email_from => 'sysupdates@example.com'
}
Let crond send emails instead of mailx
class { '::yum_autoupdate':
…
email_to => ''
}
Disable random delay
class { '::yum_autoupdate':
…
randomwait => 0
}
Exclude specific packages
class { '::yum_autoupdate':
…
exclude => ['httpd','puppet*']
}
Replace all default schedules by custom ones
class { '::yum_autoupdate':
default_schedule => false
}
yum_autoupdate::schedule { 'weekly update':
action => 'apply',
special => 'weekly',
…
}
yum_autoupdate::schedule { 'daily download':
action => 'download',
hour => '23',
minute => '30',
weekday => '*'
…
}
Usage
Class: yum_autoupdate
Primary class and entry point of the module.
Parameters within yum_autoupdate
:
service_ensure
Whether the service should be running. Valid values are stopped
and running
. Defaults to running
service_enable
Whether to enable the yum-cron service. Boolean value. Defaults to true
default_schedule
Wheteher to enable the default daily schedule. If yes, configure it using the class parameters. Boolean value. Defaults to true
keep_default_hourly
Wheteher to keep the default hourly check. Boolean value. Defaults to false
See also Common parameters
Define: yum_autoupdate::schedule
Create a yum-cron schedule
Parameters within yum_autoupdate::schedule
:
user
, hour
, minute
, month
, monthday
, weekday
, special
Please read Puppet cron type
See also Common parameters
Common parameters
Parameters common to both yum_autoupdate
and yum_autoupdate::schedule
action
Mode in which yum-cron should perform. Valid values are check
, download
and apply
. Defaults to apply
exclude
Array of packages to exclude from automatic update. Defaults to []
notify_email
Enable email notifications. Boolean value. Defaults to true
It is recommended to also adjust debug/error levels accordingly (see below)
email_to
Recipient email address for update notifications. Defaults to root
(local user)
An empty string forces the output to stdio, so emails will be sent by crond
email_from
Sender email address for update notifications. No effect when email_to
is empty. Defaults to root
(local user)
Note: not supported on CentOS 5
debug_level
YUM debug level. Valid values are numbers between -1
and 10
. -1
to disable. Default depends on the platform
Enforced to -1
when notify_email
is false
Notes:
-1
is necessary to also suppress messages from deltarpm, since0
doesn't- Always outputs to stdio on modern platforms, can apparently not be changed
error_level
YUM error level. Valid values are numbers between 0
and 10
. 0
to disable. Defaults to 0
Note: always outputs to stdio on modern platforms, can apparently not be changed
skip_broken
Enable YUM --skip-broken
option. Boolean value. Defaults to false
update_cmd
What updates to install, based on RedHat erratas. Valid values are:
default
(all available updates)security
(only packages with a security errata)security-severity:Critical
(only packages with a Critical security errata)minimal
(only upgrade to latest bugfix or security errata, ignore enhancements)minimal-security
(only upgrade to latest security errata, ignore bugfixes and enhancements)minimal-security-severity:Critical
(only upgrade to latest Critical security errata, ignore bugfixes and enhancements)
Defaults to default
Note: only supported on RHEL 7 and Fedora
randomwait
Maximum amount of time in minutes YUM randomly waits before running. Valid values are numbers between 0
and 1440
. 0
to disable. Defaults to 60
systemname
Hostname to use for identification. Defaults to undef
which should be automatically converted to the system hostname.
To Do
- Add support for passing arbitrary parameters to YUM
Testing
The only prerequisite is to have the Bundler gem installed:
$ gem install bundler
Install gem dependencies using Bundler (related documentation page here):
$ bundle install
When your environment is set up, run the spec tests inside the module directory using:
$ bundle exec rake spec
Check the puppetlabs_spec_helper GitHub repository for more information.
Contributors
Features request and contributions are always welcome!
0.6.4
New parameter systemname
(jcpunk)
0.6.3
New parameter skip_broken
(mpuel)
0.6.2
- Fix compatibility with Puppet 2.7 (jenkins101)
- Partial revert of changes introduced in v0.6.1 (Puppet 4.x)
0.6.1
- Fix compatibility with Puppet 4.0 (jhoblitt)
- Housekeeping for Travis CI (jhoblitt)
- Support Fedora 22
0.6.0
- Added spec tests, see documentation for guidelines
- Minor bugfixes
0.5.1
Fix compatibility with future parser in Puppet 3.7.4 (PUP-3615)
0.5.0
- Add custom schedules via the
yum_autoupdate::schedule
defined type - Drop support for Fedora 17 and 18
- Compatible with future parser
0.4.1
- Improve code quality, doc and metadata
- Support Fedora 21
0.4.0
update_cmd
can now be defined (ksaio!)- Deletion of the default hourly schedule on RHEL 7/Fedora 19+
- Make Puppet Doc compliant with RDoc markup language
- Refactoring
0.3.2
- Remove
email_from
feature from CentOS 5, since it is not supported - Updated documentation
0.3.1
- Adjust default
debug_level
depending on the platform debug_level
is enforced to-1
whennotify_email
is set tofalse
- Updated documentation
- Removed unused
download_only
parameter (leftover)
0.3.0
- Class parameter changes. See documentation for usage
- New class parameter
notify_email
(boolean) to disable email notifications in a more consistent way debug_level
parameter now accepts value-1
to also suppress deltarpm messages
- New class parameter
- Fixed permissions on module content, causing module upgrade to complain about changed files
- NOTE: use the
--force
option to upgrade to this release
- NOTE: use the
- Updated documentation
0.2.0
- Added support for Fedora 15+
0.1.1
- Move package exclusion logic from ERB templates to Puppet STL
- Added To Do documentation section
- Added this changelog
0.1.0
First forge release
Dependencies
- puppetlabs/stdlib (>= 1.0.0 < 5.0.0)
Copyright 2014 Antoine Cotten 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.