Defined Type: motd::message

Defined in:
manifests/message.pp

Summary

define to add some text to the motd

Overview

Parameters:

  • 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[Motd::Ansi::Colour]) (defaults to: undef)

    the color of the message



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'manifests/message.pp', line 5

define motd::message (
  String[1]                    $message  = $title,
  Integer[0, 99]               $priority = 50,
  Optional[Motd::Ansi::Colour] $color    = undef,
) {
  $_message = $color ? {
    undef   => $message,
    default => motd::ansi::fg($message, $color)
  }
  $content = @("CONTENT")
    #!/bin/sh
    printf "%s\n" "${_message}"
    | CONTENT
  motd::script { $title:
    priority => $priority,
    content  => $content,
  }
}