Forge Home

meta_motd

Create a message of the day that includes metadata about the node

1,181 downloads

1,181 latest version

5.0 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Version information

  • 1.0.0 (latest)
released Sep 17th 2021
This version is compatible with:
  • Puppet Enterprise 2023.2.x, 2023.1.x, 2023.0.x, 2021.7.x, 2021.6.x, 2021.5.x, 2021.4.x, 2021.3.x, 2021.2.x, 2021.1.x, 2021.0.x, 2019.8.x, 2019.7.x, 2019.5.x, 2019.4.x, 2019.3.x, 2019.2.x, 2019.1.x
  • Puppet >= 6.1.0 < 8.0.0
  • , , , , , , , ,

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'ploperations-meta_motd', '1.0.0'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add ploperations-meta_motd
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install ploperations-meta_motd --version 1.0.0

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Download

Documentation

ploperations/meta_motd — version 1.0.0 Sep 17th 2021

Reference

Table of Contents

Classes

Public Classes

  • meta_motd: Update /etc/motd with information about the host

Private Classes

  • meta_motd::keyvalue::blank: Adds blank link after the meta_motd::keyvalue entries
  • meta_motd::register::blank: Adds blank link after the meta_motd::register entries

Defined types

Public Defined types

Private Defined types

  • meta_motd::register: Deprecated: add an old-style entry to the MOTD.

Classes

meta_motd

Update /etc/motd with information about the host.

  • If the system is a Puppet Enterprise server an entry will automatically be added to the MOTD showing what version of PE is installed.
  • Similarly, an entry will be added showing what the certname used by the system is if the FQDN and the certname do not match.

Note: It is sometimes useful to disable changes to /etc/motd when comparing runs in different environments. You can do that like so: sudo FACTER_suppress_motd=true puppet agent --test ...

Examples

Set MOTD template based on a conditional expression
class profile::motd {
  case $profile::server::someparam {
    /infranext/: { $motd_template = 'meta_motd/colossal-puppet-dag.epp' }
    default:     { $motd_template = 'meta_motd/short-puppet.epp' }
  }

  class { 'meta_motd':
    epp_template => $motd_template,
    epp_params   => {
      roles    => lookup('classes', Array[String], 'unique', []),
      location => $facts['whereami'],
    },
  }
}
Use a template stored in your profile module
class { 'meta_motd':
  epp_template => 'profile/motd.epp',
}

Parameters

The following parameters are available in the meta_motd class:

epp_template

Data type: String[1]

This is the path to an EPP template passed into content parameter of a concat::fragment resource. All templates in this module are avaialable by setting this to meta_motd/<name of template file>. This can also be set to use an EPP templates from another module by replacing the meta_motd part of the path.

Default value: 'meta_motd/short-puppet.epp'

epp_params

Data type: Hash

This represents the parameters that will be passed to the template referenced in $epp_template. If you have defined a template that does not need parameters you can set this to {}.

Default value: { roles => lookup('classes', Array[String], 'unique', []), location => undef, }

Defined types

meta_motd::fragment

Add a fragment to the MOTD, if allowed

Examples

meta_motd::fragment { 'EoL Notice':
  content => @(END),
    NOTICE: this system is scheduled for decommissioning within the next two weeks
    Contact IT if this poses a problem for you or your team.
    | END
}

Parameters

The following parameters are available in the meta_motd::fragment defined type:

content

Data type: String[1]

the content to add to the MOTD

Default value: $title

order

Data type: String[2]

the order option to be passed to the concat::fragment

Default value: '50'

meta_motd::keyvalue

Add a line to the "key: value" section of the MOTD. All such values go between the header and entries added via meta_motd::register. Services added by the profile_metadata module will also be below these entries.

Examples

meta_motd::keyvalue { "PE build: ${facts['pe_build']}": }
meta_motd::keyvalue { "Jenkins alias: ${url}": }

Parameters

The following parameters are available in the meta_motd::keyvalue defined type:

content

Data type: String[5]

A string in "key: value" format. The key must start with a word character (regex \w). It can then have zero or more spaces, word characters, or dashes. Next it must contain another word character followed by a colon and a space.

Default value: $title