Manage automated system updates

Adam Stephens



18,192 latest version

4.0 quality score

Version information

  • 0.4.5 (latest)
  • 0.4.4
  • 0.4.3
  • 0.4.2
  • 0.4.1
  • 0.4.0
  • 0.3.1
  • 0.3.0
  • 0.2.1
  • 0.2.0
released Dec 14th 2015
This version is compatible with:
  • RedHat

Start using this module


adamcstephens/systemupdates — version 0.4.5 Dec 14th 2015


Puppet Forge

Table of Contents

  1. Usage
  2. Reference

Puppet module for configuring systems for automatic package updates. This module provides a custom update mechanism which utilizes distribution package managers, allowing for a consistent update experience across supported distributions.

This module is designed to run from a cron task, and will only output on a failed return code from a task.

The following distributions are known to be supported:

  • CentOS/RHEL 5-7
  • Ubuntu 14.04

Please file an issue if you have successfully tested this on other apt/yum systems.


Default update mechanism is once a week on Wed at 4am with a random minute (0-59). These can be customized with class paramaters.


class { '::systemupdates':
  day => 'Wed',
  hour => '4',
  minute => fqdn_rand(59),
  auto_reboot => false,


You can use Hiera to customize the configuration more granularly. Make sure to use single quotes if referencing the shell script variables

systemupdates::use_crontab: false
systemupdates::use_anacron: 'daily'
    - elasticsearch
    - logstash
  elasticsearch: "elasticsearch"
  - 'apt-get -y $APTARGS dist-upgrade puppet'
  - 'apt-get -y $APTARGS -f install'
  - 'apt-get -y $APTARGS autoremove'
  - glibc
  - openssl




Whether to create a crontab entry for root.

Default: true


Whether to create an anacron file. Must be one of hourly, daily, weekly or monthly if set.

Default: false


Wether to automatically reboot, if necessary, after completion of upgrade.

Default: false


An optional array of packages to exclude from the update process.

Note: this only works on Red Hat and derivatives. Debian-based systems will need to utilize package pinning, which is not managed by this module.

Default: undef


Day of the week for root crontab entry. See cron type

Default: Wed


Hour of the day for root crontab entry. See cron type

Default: 4 (am)


Minute of the hour for root crontab entry. See cron type

Default: fqdn_rand(59)


How frequently to rotate logs. See logrotate documentation.

Default: monthly


How many rotated logs to keep. See logrotate documents.

Default: 12


Whether this module should try and clean up OS native methods for automatic upgrades.

Default: false


Package to service mapping which will automatically restart services if package is upgraded. See Hiera example above.

NOTE Keys off current date. Will restart services every time run during matching day.

Default: undef


Site specific commands which should be run after the upgrade process. See Hiera example above.

Default: undef


Array of site specific packages which should trigger a system reboot. Currently only supports rpm systems.

NOTE Only supports RPM-based systems, and keys off current date. Will reboot every time run during matching day.

Default: empty


Array of site specific commands which should be run before the upgrade process. Similar to custom_commands.

Default: empty


Please feel free to submit pull requests or file bugs/feature requests. I developed this module for my purposes, but hope others will find it of use.