meta_motd: Update /etc/motd with information about the host
meta_motd::keyvalue::blank: Adds blank link after themeta_motd::keyvalueentriesmeta_motd::register::blank: Adds blank link after themeta_motd::registerentries
meta_motd::fragment: Add a fragment to the MOTD, if allowedmeta_motd::keyvalue: Add a line to the "key: value" section of the MOTD
meta_motd::register: Deprecated: add an old-style entry to the 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 ...
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'],
},
}
}class { 'meta_motd':
epp_template => 'profile/motd.epp',
}The following parameters are available in the meta_motd class:
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'
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, }
Add a fragment to the MOTD, if allowed
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
}The following parameters are available in the meta_motd::fragment defined type:
Data type: String[1]
the content to add to the MOTD
Default value: $title
Data type: String[2]
the order option to be passed to the concat::fragment
Default value: '50'
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.
meta_motd::keyvalue { "PE build: ${facts['pe_build']}": }meta_motd::keyvalue { "Jenkins alias: ${url}": }The following parameters are available in the meta_motd::keyvalue defined type:
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