Forge Home

systemupdates

Manage automated system updates

27,500 downloads

19,263 latest version

4.0 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Support the Puppet Community by contributing to this module

You are welcome to contribute to this module by suggesting new features, currency updates, or fixes. Every contribution is valuable to help ensure that the module remains compatible with the latest Puppet versions and continues to meet community needs. Complete the following steps:

  1. Review the module’s contribution guidelines and any licenses. Ensure that your planned contribution aligns with the author’s standards and any legal requirements.
  2. Fork the repository on GitHub, make changes on a branch of your fork, and submit a pull request. The pull request must clearly document your proposed change.

For questions about updating the module, contact the module’s author.

Version information

  • 0.4.5 (latest)
  • 0.4.4
  • 0.4.3
  • 0.4.2 (deleted)
  • 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:
  • , ,

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'adamcstephens-systemupdates', '0.4.5'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add adamcstephens-systemupdates
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install adamcstephens-systemupdates --version 0.4.5

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Download

Documentation

adamcstephens/systemupdates — version 0.4.5 Dec 14th 2015

puppet-systemupdates

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.

Usage

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

Manifest

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

Hieradata

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'
systemupdates::pkgtosvcrestart:
  jre:
    - elasticsearch
    - logstash
  elasticsearch: "elasticsearch"
systemupdates::custom_commands:
  - 'apt-get -y $APTARGS dist-upgrade puppet'
  - 'apt-get -y $APTARGS -f install'
  - 'apt-get -y $APTARGS autoremove'
systemupdates::pkgtosystemreboot:
  - glibc
  - openssl

Reference

Paramaters

###use_crontab

Whether to create a crontab entry for root.

Default: true

###use_anacron

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

Default: false

###auto_reboot

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

Default: false

###exclude

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

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

Default: Wed

###hour

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

Default: 4 (am)

###minute

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

Default: fqdn_rand(59)

###logrotate_freq

How frequently to rotate logs. See logrotate documentation.

Default: monthly

###logrotate_keep

How many rotated logs to keep. See logrotate documents.

Default: 12

###disable_os_methods

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

Default: false

###pkgtosvcrestart

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

###custom_commands

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

Default: undef

###pkgtosystemreboot

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

###custom_pre_commands

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

Default: empty

Other

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.