meta_motd
Version information
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
Add this module to your Puppetfile:
mod 'ploperations-meta_motd', '1.0.0'
Learn more about managing modules with a PuppetfileDocumentation
meta_motd
Description
The message of the day, or MOTD, is the first thing a user sees when logging into a system. Providing contextual information about the system allows users to quickly get an overview of what the system does. This module is used internally at Puppet and is actively maintained.
Examples
Below are a some examples of what this module can produce.
Note that the
Consul Agent (profile::consul)
line below each MOTD was added by ploperations/profile_metadata
short-puppet.epp:
canary-basic-debian8-dev-1.example.net - 10.0.0.20 - opdx
_____ _
| _ |_ _ ___ ___ ___| |_
| __| | | . | . | -_| _| Puppet 6.10.1 in production
|__| |___| _| _|___|_| role::canary::basic
|_| |_|
Canary node
role::canary::basic owned by team infracore
Consul Agent (profile::consul)
tall-puppet.epp:
____ __ __ ____ ____ ___ ______
| \| | || \| \ / _] | Env: production
| o ) | || o ) o ) [_| | OS: Debian 8 aka jessie
| _/| | || _/| _/ _]_| |_| Location: opdx in vmware
| | | : || | | | | [_ | | Puppet: 6.10.1
| | | || | | | | | | |
|__| \__,_||__| |__| |_____| |__|
FQDN: canary-basic-debian8-dev-1.example.net
Canary node
role::canary::basic owned by team infracore
Consul Agent (profile::consul)
colossal-puppet-dag.epp:
canary-basic-debian8-dev-1.example.net - 10.0.0.20 - opdx
8888888b. 888 @@@@@@@@@@@@@@@
888 Y88b 888 @,,,,,,@@@@@@@@
888 888 888 @,,@@,,@@@@@@@@
888 d88P 888 888 88888b. 88888b. .d88b. 888888 @,,,,,,,@@@@@@@
8888888P" 888 888 888 "88b 888 "88b d8P Y8b 888 @@@@@@@@,,,,,,@ Puppet 6.10.1 in production
888 888 888 888 888 888 888 88888888 888 @@@@@@@@,,,,,,@ role::canary::basic
888 Y88b 888 888 d88P 888 d88P Y8b. Y88b. @@@@@@@@,,,,,,@
888 "Y88888 88888P" 88888P" "Y8888 "Y888 @,,,,,,,@@@@@@@
888 888 @,,@@,,@@@@@@@@
888 888 @,,,,,,@@@@@@@@
888 888 @@@@@@@@@@@@@@@
Canary node
role::canary::basic owned by team infracore
Consul Agent (profile::consul)
Setup
This module will fully manage /etc/motd
while also allowing other module (or profiles) to add information to it. This module will work without additional setup on your part. See Reference on the Puppet Forge or REFERENCE.md on GitHub for additional details about setup options.
Usage
include meta_motd
Reference
This module is documented via pdk bundle exec puppet strings generate --format markdown
. Please see Reference on the Puppet Forge or REFERENCE.md on GitHub for more info.
Changelog
CHANGELOG.md is generated prior to each release via pdk bundle exec rake changelog
. This process relies on labels that are applied to each pull request.
Limitations
This module does not currently do anything on Windows nodes.
Development
PR's, including ones with additional templates, are welcome!
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 themeta_motd::keyvalue
entriesmeta_motd::register::blank
: Adds blank link after themeta_motd::register
entries
Defined types
Public Defined types
meta_motd::fragment
: Add a fragment to the MOTD, if allowedmeta_motd::keyvalue
: Add a line to the "key: value" section of the MOTD
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
Change log
All notable changes to this project will be documented in this file. The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
1.0.0 (2021-09-18)
Changed
* This Changelog was automatically generated by github_changelog_generator
Dependencies
- puppetlabs/concat (>= 4.2.1 < 7.0.0)
- puppetlabs/stdlib (>= 5.1.0 < 7.0.0)