Skip to content

Latest commit

 

History

History
90 lines (67 loc) · 2.13 KB

README.md

File metadata and controls

90 lines (67 loc) · 2.13 KB

needrestart puppet module

Table of Contents

  1. Description
  2. Setup
  3. Usage
  4. Parameters
  5. Limitations

Description

Restarts needed services automatically. Installs package, configures mode (list, automatic, interactive). Adds groups of services to ignore list.

Setup

What needrestart affects

Once installed, needrestart hooks into package management and init systems. For example, upgrading openssl via apt will restart exim and apache if they have proper init scripts.

Usage

To automatically restart everything except bareos-fd, mysql, exim4, dovecot and apache2 if needed:

class { 'needrestart':
  action      => 'automatic',
  ignorelist  => {'Backups'    => ['bareos-fd'],
                  'Databases'  => ['mysql'],
                  'Mail'       => ['exim4','dovecot'],
                  'Webservers' => ['apache2']},
  }
}

Another hiera example:

---
classes:
  - needrestart

needrestart::action: 'interactive'
needrestart::disable_kernel_hints: false
needrestart::notify_user_obsolete_binaries: true
needrestart::preferred_ui: 'debconf'
needrestart::ignorelist:
  'Virtualization':
    - 'libvirt-bin'
  'Applications'
    - 'tomcat8'

Parameters

action

String to specify default action. Possible values are:

  • list (default)
  • interactive
  • automatic

preferred_ui

String to set preferred ui. Possible values are:

  • stdio (default)
  • debconf.

ignorelist

See example in usage above.

disable_kernel_hints

Boolean to specify if hints on pending kernel upgrades are hidden or not. Possible values are:

  • true (default)
  • false

notify_user_obsolete_binaries

Boolean to specify if a user is notified about obsolete binaries in his session or not. Possible values are:

  • true (default)
  • false

package_ensure

String for ensure parameter to the needrestart package. Default value is "installed".

package_name

String to specify the package name. Default value is "needrestart".

Limitations

Only tested on Debian 7.0 and Ubuntu >= 14.04