Defined Type: system::role

Defined in:
modules/system/manifests/role.pp

Summary

Adds a banner message to the server MOTD (usually displayed on login) that identifies the role of the server.

Overview

SPDX-License-Identifier: Apache-2.0

Examples:

system::role { 'analytics::hadoop::master':
  description => 'Hadoop Master (NameNode & ResourceManager)'
}

Parameters:

  • ensure (Wmflib::Ensure) (defaults to: present)

    Present or absent. (Default: present.)

  • description (Optional[String[1]]) (defaults to: undef)

    A human-readable description of the role. Optional.



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'modules/system/manifests/role.pp', line 14

define system::role(
    Wmflib::Ensure      $ensure      = present,
    Optional[String[1]] $description = undef,
) {
    $role_title = regsubst($title, '^role::', '')

    $message = $description ? {
        undef   => "${facts['networking']['hostname']} is ${role_title}",
        default => "${facts['networking']['hostname']} is a ${description} (${role_title})",
    }

    motd::message { "role-${role_title}":
        ensure   => $ensure,
        priority => 5,
        message  => $message,
    }
}