Using Puppet to create a banner when logging in a server

124 views
Skip to first unread message

Zman112233

unread,
Jan 12, 2011, 2:08:57 PM1/12/11
to Puppet Users
Hello everyone,

I'm new to the Puppet world and I was looking for a little beginning
help...

I'd like to create a banner for anyone logging into a list of servers
to see (i.e. Unauthorized access prohibited, you're being watched,
etc...).

I'd like to base it off the /etc/issue and /etc/issue.net files. I
thought it might be easier if I had an example to work though as I'm
learning Puppet.

Any suggestions?

Gary Law

unread,
Jan 12, 2011, 5:33:07 PM1/12/11
to puppet...@googlegroups.com
On 12 January 2011 19:08, Zman112233 <zachary...@hotmail.com> wrote:

> I'd like to create a banner for anyone logging into a list of servers
> to see (i.e. Unauthorized access prohibited, you're being watched,
> etc...).

I have a "prettymotd" module. The init.pp reads:

class prettymotd {
file { "/etc/motd":
content => template("prettymotd/motd.erb"),
ensure => present
}
}

and the motd.erb is:-

hostname: <%= fqdn %>
type: <%= operatingsystem %> <%= operatingsystemrelease %>
<%= kernelversion %> <%= kernel %>
hardware: <%= hardwaremodel %>

HTH

Gary

--
Gary Law
Email/Chat googletalk/messenger: gary...@gmail.com

Daniel Pittman

unread,
Jan 13, 2011, 12:10:29 AM1/13/11
to puppet...@googlegroups.com
On Wed, Jan 12, 2011 at 14:33, Gary Law <gar...@garylaw.net> wrote:
> On 12 January 2011 19:08, Zman112233 <zachary...@hotmail.com> wrote:
>
>> I'd like to create a banner for anyone logging into a list of servers
>> to see (i.e. Unauthorized access prohibited, you're being watched,
>> etc...).
>
> I have a "prettymotd" module. The init.pp reads:

[...]

So, Gary had that pretty much nailed down, but a few bits I would add
as pointers you can ask to expand or read up on yourself:

You should put this in a module, so that it is nicely self-contained,
and include the appropriate class in your nodes. For a single task
like this that isn't going to be much different to doing it without,
but it makes good practice for doing modules when you get to the jobs
that *do* benefit from them.

If you were looking to base it of the existing issue files then I
would take the view that you should copy them into your module, modify
them as required, and then go on.

Regards,
Daniel
--
✉ Daniel Pittman <dan...@rimspace.net>
dan...@rimspace.net (XMPP)
+1 503 893 2285
♻ made with 100 percent post-consumer electrons

Reply all
Reply to author
Forward
0 new messages