Forge Home

reboot

This module provides a facility to manage reboots across nodes.

3,266,036 downloads

33,143 latest version

2.8 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.

Version information

  • 5.0.0 (latest)
  • 4.3.1
  • 4.3.0
  • 4.2.0
  • 4.1.0
  • 4.0.2
  • 4.0.1
  • 4.0.0
  • 3.2.0
  • 3.1.0
  • 3.0.0
  • 2.4.0
  • 2.3.0
  • 2.2.0
  • 2.1.2
  • 2.1.1
  • 2.0.0
  • 1.2.1
  • 1.2.0
  • 1.1.0
  • 1.0.0
  • 0.1.9
  • 0.1.8
  • 0.1.7
  • 0.1.6
  • 0.1.5
  • 0.1.4
  • 0.1.2
  • 0.1.1
  • 0.1.0
released Mar 3rd 2014
This version is compatible with:
  • Puppet Enterprise 3.2.x
  • Puppet 3.x

Start using this module

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

Add this module to your Puppetfile:

mod 'puppetlabs-reboot', '0.1.5'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add puppetlabs-reboot
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install puppetlabs-reboot --version 0.1.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
Tags: windows, reboot

Documentation

puppetlabs/reboot — version 0.1.5 Mar 3rd 2014

reboot

##Overview

This module adds a type and Windows provider for managing system reboots.

##Module Description

This module provides a type and provider for managing systems reboots. Currently, only Windows is supported.

The module supports two forms of reboots. The first form occurs when puppet installs a package, and a reboot is required to complete installation. This is the default mode of operation, as it ensures puppet will only reboot the system in response to another resource being applied, such as a package install.

The second form is where a reboot is pending, and puppet needs to reboot the system before applying any other resources. For example, some Windows packages cannot be installed while a reboot is pending. The second form is specified via when => pending.

##Setup

###Beginning with reboot

The best way to install this module is with the puppet module subcommand. On your puppet master, execute the following command, optionally specifying your puppet master's modulepath in which to install the module:

$ puppet module install [--modulepath <path>] puppetlabs/reboot

See the section Installing Modules for more information.

##Usage

To install .NET 4.5 and reboot, but only if the package needed to be installed:

package { 'Microsoft .NET Framework 4.5':
  ensure          => installed,
  source          => '\\server\share\dotnetfx45_full_x86_x64.exe',
  install_options => ['/Passive', '/NoRestart'],
  provider        => windows,
}
reboot { 'after':
  subscribe       => Package['Microsoft .NET Framework 4.5'],
}

To check if a reboot is pending, and if so, reboot the system before installing .NET 4.5:

reboot { 'before':
  when            => pending,
}
package { 'Microsoft .NET Framework 4.5':
  ensure          => installed,
  source          => '\\server\share\dotnetfx45_full_x86_x64.exe',
  install_options => ['/Passive', '/NoRestart'],
  provider        => windows,
  require         => Reboot['before'],
}

By default, when the provider triggers a reboot, it will skip any resources in the catalog that have not yet been applied. Alternatively, you can allow puppet to continue applying the entire catalog by specifying apply => finished. For example, if you have several packages that all require reboots, but will not block each other:

package { 'Microsoft .NET Framework 4.5':
  ensure => installed,
  ...
  notify => Reboot['after_run'],
}
package { 'Microsoft Windows SDK for Windows 7 (7.0)':
  ensure => installed,
  ...
  notify => Reboot['after_run'],
}
reboot { 'after_run':
  apply  => finished,
}

##Limitations

  • On Windows, the 'shutdown.exe' command must be in the PATH.
  • On Windows 2003 (non-R2) x64, KB942589 must be installed.
  • If using when => pending style reboots, puppet will apply heuristics to determine if a reboot is pending, e.g. the existence of the PendingFileRenameOperations registry key. If the system reboots, but does not resolve the reboot pending condition, then puppet will reboot the system again. This could lead to a reboot cycle.
  • If puppet performs a reboot, any remaining items in the catalog will be applied the next time puppet runs. In other words, it may take more than one run to reach consistency. In situations where puppet is running as a service, puppet should execute again after the machine boots.
  • In puppet 3.3.0 and up, if puppet performs a reboot, any resource in the catalog that is skipped will be marked as such in the report. In versions prior, skipped resources are omitted from the report.
  • The prompt parameter should only be used with puppet apply. The prompt isn't displayed during puppet agent runs, which causes the operation to wait indefinitely.

##License

Apache License, Version 2.0