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 %>
#################################
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?
Add a space in the last line to see if it can solve it.
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.
Does it ignore the empty lines between the two seperate lines (I mean #############)?