Puppet motd template


Selection_018

1) Create the manifest of sys_motd module

/etc/puppet/environments/development/modules/sys_motd/manifests/init.pp

class sys_motd {
file { ‘/etc/motd’:
ensure => file,
content => template(‘sys_motd/motd.erb’),
}
}

2) Create a ERB file as the motd template

/etc/puppet/environments/development/modules/sys_motd/templates/motd.erb

#################################

HOST: <%= fqdn %>
OS: <%= operatingsystem %>
VERSION: <%= operatingsystemrelease %>
ENVIRONMENT: <%= environment %>

#################################

Advertisement

4 thoughts on “Puppet motd template

  1. The problem I’m having using a template for motd (puppet 3.7) is the blank line at the end is ignored and then the login prompt is placed on the last line of the motd. How do I solve this?

      1. Doesn’t help. This is Red Hat Satellite 6 puppet. It has a form that you copy the text for motd, issue, issue.net into. When you run puppet agent -t, no matter how many carriage returns you end the text with, you get – no newline at end of file and everything runs together.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s