Defined Type: motd::message

Defined in:
modules/motd/manifests/message.pp

Summary

define to add some text to the motd

Overview

SPDX-License-Identifier: Apache-2.0

Parameters:

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

    ensureable param

  • message (String[1]) (defaults to: $title)

    the message to add, use title by default

  • priority (Integer[0, 99]) (defaults to: 50)

    the motd priority

  • color (Optional[Wmflib::Ansi::Colour]) (defaults to: undef)


6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'modules/motd/manifests/message.pp', line 6

define motd::message (
    Wmflib::Ensure                 $ensure   = present,
    String[1]                      $message  = $title,
    Integer[0, 99]                 $priority = 50,
    Optional[Wmflib::Ansi::Colour] $color    = undef,
) {

    $_message = $color ? {
        undef   => $message,
        default => wmflib::ansi::fg($message, $color)
    }
    $content = @("CONTENT")
    #!/bin/sh
    printf "%s\n" "${_message}"
    | CONTENT
    motd::script { $title:
        ensure   => $ensure,
        priority => $priority,
        content  => $content,
    }
}