Ask Your Question

Generate /etc/motd : list of classes used on specific node

asked 2013-05-21 03:15:58 -0600

scoopex gravatar image

My motd-puppet-module (generates /etc/motd) module contains a erb-template which contains the following code:

Puppet classes:
<% classes.each do |klass| -%><%= klass -%> <% end -%>
<% end -%>

I used this to provide a quick overview what is managed by puppet at login.

Unfortunately the list of classes is never complete - i suppose this is caused by resource/class ordering. Are there better ways to get the namens of all assigned classes of a node?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2013-05-23 19:25:17 -0600

stahnma gravatar image

How does classes.txt look? Couldn't you just include that in your motd?

edit flag offensive delete link more

answered 2013-05-22 01:38:23 -0600

updated 2013-05-22 01:38:51 -0600

You could try to have that motd module run during the stage 'last', see for example :

stage { 'last': }
Stage['main'] -> Stage['last']

As long as you don't put other modules to run during stage, motd should be the last

class { 'motd':
      stage => last,
edit flag offensive delete link more


Thanks, seems to be the solution - a quick test didn't improve the situation. I will test this in the next days....

scoopex gravatar imagescoopex ( 2013-05-23 18:51:42 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2013-05-21 03:15:58 -0600

Seen: 312 times

Last updated: May 23 '13