Puppet Class: profile::base::reboot_unattended

Defined in:
modules/profile/manifests/base/reboot_unattended.pp

Overview

SPDX-License-Identifier: Apache-2.0

Class profile::base::reboot_unattended

This class can be used mark a host for unattended reboots. This profile just marks the host but no actual reboot will be executed. The reboot happens in a dedicated cookbook.

Parameters:

  • $allow —

    mark the host and allow unattended reboots, default false

  • allow (Boolean) (defaults to: lookup('profile::base::reboot_unattended::allow', { default_value => false }))


9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'modules/profile/manifests/base/reboot_unattended.pp', line 9

class profile::base::reboot_unattended (
    Boolean $allow = lookup('profile::base::reboot_unattended::allow', { default_value => false }),
) {
    $ensure_file = $allow ? {
      true    => file,
      default => absent,
    }

    file { '/etc/wikimedia/reboot-unattended':
        ensure  => 'directory',
        mode    => '0644',
        recurse => true,
        purge   => true,
    }

    file { '/etc/wikimedia/reboot-unattended/allow.conf':
        ensure  => $ensure_file,
        mode    => '0644',
        content => "allow\n",
    }
}