seeing too many change messages.

59 views
Skip to first unread message

Muhammad Yousuf Khan

unread,
Jan 20, 2014, 9:25:18 AM1/20/14
to puppet...@googlegroups.com
hello guys,

i am  new to puppet and few days back have installed motd module for testing this is my first module working great however i just see too many change messages since the day motd module has installed.
this is what i see in all the messages
this message showed up as CHANGE in every agent run. on both puppet server and puppet client.
notice content changed '{md5}2efaxxxxxxxxxxb992815fe4852f6912' to '{md5}9f5xxxxxxxxxxxx0436d1a3836baa8b' /Stage[main]/Motd/File[/etc/motd]/content /etc/puppetlabs/puppet/modules/motd/manifests/init.pp


i have made some changes in below init.pp file.
/etc/puppetlabs/puppet/modules/motd/manifests/init.pp

do you guys think all those change event logs are fine?

Thanks,

Myk

Felix Frank

unread,
Jan 20, 2014, 10:01:13 AM1/20/14
to puppet...@googlegroups.com
Hi,

On 01/20/2014 03:25 PM, Muhammad Yousuf Khan wrote:
> hello guys,
>
> i am new to puppet and few days back have installed motd module for
> testing this is my first module working great however i just see too
> many change messages since the day motd module has installed.
> this is what i see in all the messages
> this message showed up as CHANGE in every agent run. on both puppet
> server and puppet client.
> |notice| |content changed '{md5}2efaxxxxxxxxxxb992815fe4852f6912' to
> '{md5}9f5xxxxxxxxxxxx0436d1a3836baa8b'|

I like how you anonymized your md5 hashes :-)

No need to do that - these don't convey any sensible information to us.

> |/Stage[main]/Motd/File[/etc/motd]/content|
> |/etc/puppetlabs/puppet/modules/motd/manifests/init.pp|
> i have made some changes in below init.pp file.
> |/etc/puppetlabs/puppet/modules/motd/manifests/init.pp|

This bit is alarming. You manage your manifests through puppet?

This is actually self modifying code. The fact that it keeps modifying
itself on every run indicates some problem, I believe.

I recommend not doing that at all. Worst case scenario is SkyNet sending
back cybernetic assassins in time.

Cheers,
Felix
Message has been deleted

Muhammad Yousuf Khan

unread,
Jan 21, 2014, 1:47:26 AM1/21/14
to puppet...@googlegroups.com


On Monday, January 20, 2014 8:01:13 PM UTC+5, Felix.Frank wrote:
Hi,

On 01/20/2014 03:25 PM, Muhammad Yousuf Khan wrote:
> hello guys,
>
> i am  new to puppet and few days back have installed motd module for
> testing this is my first module working great however i just see too
> many change messages since the day motd module has installed.
> this is what i see in all the messages
> this message showed up as CHANGE in every agent run. on both puppet
> server and puppet client.
> |notice|         |content changed '{md5}2efaxxxxxxxxxxb992815fe4852f6912' to
> '{md5}9f5xxxxxxxxxxxx0436d1a3836baa8b'|

I like how you anonymized your md5 hashes :-)
LoL :P.

No need to do that - these don't convey any sensible information to us.

> |/Stage[main]/Motd/File[/etc/motd]/content|
> |/etc/puppetlabs/puppet/modules/motd/manifests/init.pp|
> i have made some changes in below init.pp file.
> |/etc/puppetlabs/puppet/modules/motd/manifests/init.pp|

This bit is alarming. You manage your manifests through puppet?
yes , actually this is my first test. just trying to play with puppet

This is actually self modifying code. The fact that it keeps modifying
itself on every run indicates some problem, I believe.

what i did is just tried to place my own text including what motd addon has written by default.
i added just this line "unauthorized use is prohibited"
and i want this to be place in all the live nodes in my Linux farm no matter VM or physical server.
 

I recommend not doing that at all. Worst case scenario is SkyNet sending
back cybernetic assassins in time.


sorry my English is not that good. i couldn't get your point by not doing, what? do you mean not to edit the ppl file or i should not use the motd addon at all.

 
Cheers,
Felix

Dick Davies

unread,
Jan 21, 2014, 5:55:52 AM1/21/14
to puppet...@googlegroups.com
On 21 January 2014 06:47, Muhammad Yousuf Khan <sir...@gmail.com> wrote:
>
>
> On Monday, January 20, 2014 8:01:13 PM UTC+5, Felix.Frank wrote:
>>
>> Hi,
>>
>> On 01/20/2014 03:25 PM, Muhammad Yousuf Khan wrote:
>> > hello guys,
>> >
>> > i am new to puppet and few days back have installed motd module for
>> > testing this is my first module working great however i just see too
>> > many change messages since the day motd module has installed.
>> > this is what i see in all the messages


>> > |/Stage[main]/Motd/File[/etc/motd]/content|
>> > |/etc/puppetlabs/puppet/modules/motd/manifests/init.pp|
>> > i have made some changes in below init.pp file.
>> > |/etc/puppetlabs/puppet/modules/motd/manifests/init.pp|
>>
>> This bit is alarming. You manage your manifests through puppet?
>
> yes , actually this is my first test. just trying to play with puppet

this is - odd, then. The manifests should be up on the master, not the nodes.
Post that init.pp somewhere.

jcbollinger

unread,
Jan 21, 2014, 9:18:42 AM1/21/14
to puppet...@googlegroups.com


Probably not.  You don't seem to grasp what Felix is trying to tell you: the log shows Puppet modifying one of the manifest files that describe to it the target state of your nodes.  That's surely not the responsibility of a motd module, and it would be a highly suspect behavior in any module.  I have never heard a good use case for Puppet managing its own manifests, and if there is one then it is by no means something a Puppet newbie should be playing with.  The only file a well-made motd module should manage is /etc/motd.

As for frequency of change messages, you will get such messages in the log every time Puppet changes something.  If it changes a given file every run, then you will get such messages every run.  One of the traps that folks sometimes fall into is putting a dynamic modification timestamp in managed file content.  That causes the file to be modified on every run, if only to update the timestamp.

If you post you 'motd' class then we will have something concrete to talk about.


John

Muhammad Yousuf Khan

unread,
Jan 22, 2014, 4:04:52 AM1/22/14
to puppet...@googlegroups.com

sorry i think i totally mess up the thread please forgive me as i am very new and trying to learn whole puppet structure which is kinda confusing me. and i i am motivated and with your guidance/advices i will achieve my required goal.

here is what i did.
1- i installed motd module.
2- i neno :/etc/puppetlabs/puppet/modules/motd/templates# nano motd.erb
here is my motd.erb look like.

The operating system is <%= operatingsystem %>
The free memory is <%= memoryfree %>
The domain is <%= domain %>
In case of any problem please consult your TL.
# i added this list line. for testing

3 -  i didnt made any change anything in manifests, here is my init.pp

# Class: motd
#
# This module manages the /etc/motd file using a template
#
# Parameters:
#
# Actions:
#
# Requires:
#
# Sample Usage:
#  include motd
#
# [Remember: No empty lines between comments and class definition]
class motd {
  if $kernel == "Linux" {
    file { '/etc/mo# Class: motd
#
# This module manages the /etc/motd file using a template
#
# Parameters:
#
# Actions:
#
# Requires:
#
# Sample Usage:
#  include motd
#
# [Remember: No empty lines between comments and class definition]
class motd {
  if $kernel == "Linux" {
    file { '/etc/motd':
      ensure  => file,
      backup  => false,
      content => template("motd/motd.erb"),
    }
  }
}

now here is my report which shows every puppet run sucessfully change something which i think is quite unnesassory since one change is updated i think there is no need to reupdate the change when nothing is actually change.
Changed 2014-01-22 08:55 UTC puppet.xxxxxxxx.com 194 0 1 193 0 0 0 10.42 s 29.74 s
Changed 2014-01-22 08:52 UTC puppetagent.xxxxxxxx.com 85 0 1 84 0 0 0 2.59 s 3.12 s
Unchanged 2014-01-22 08:25 UTC puppet.xxx.com 194 0 0 194 0 0 0 7.63 s 29.17 s
Changed 2014-01-22 08:22 UTC puppetagen.xxx.com 85 0 1 84 0 0 0 1.97 s 2.46 s
Unchanged 2014-01-22 07:55 UTC puppet.xxx.com 194 0 0 194 0 0 0 7.80 s 26.62 s
Changed 2014-01-22 07:52 UTC puppetagent.xxx.com 85 0 1 84 0 0 0 2.17 s 2.83 s
Unchanged 2014-01-22 07:25 UTC puppet.xxx.com 194 0 0 194 0 0 0 10.43 s 28.18 s
Changed 2014-01-22 07:22 UTC puppetagent.xxx.com 85 0 1 84 0 0 0 2.00 s 2.49 s
Changed 2014-01-22 06:55 UTC puppet.xxx.com 194 0 1 193 0 0 0 8.08 s 24.98 s
Changed 2014-01-22 06:52 UTC puppetagent.xxx.com 85 0 1 84 0 0 0 2.49 s 3.03 s
Changed 2014-01-22 06:25 UTC puppet.xxx.com 194 0 1 193 0 0 0 11.44 s 28.26 s
Changed 2014-01-22 06:22 UTC puppetagent.xxx.com 85 0 1 84 0 0 0 2.54 s 2.93 s
Changed 2014-01-22 05:55 UTC puppet.xxx.com 194 0 1 193 0 0 0 7.65 s 27.29 s
Changed 2014-01-22 05:52 UTC puppetagent.xxx.com 85 0 1 84 0 0 0 2.37 s 2.94 s

and there is a log list of these change event why i am getting these blue/changed messages on every puppet run. i have changed the motd.erb 5 days back. and log reports shows that things are still changing.

any idea. please help.
 



John

Felix Frank

unread,
Jan 22, 2014, 4:08:16 AM1/22/14
to puppet...@googlegroups.com
Hi,

On 01/22/2014 10:04 AM, Muhammad Yousuf Khan wrote:
> The free memory is <%= memoryfree %>

the $memoryfree fact is bound to have a different value on each puppet
run, I think.

Try and remove this line from your template.

HTH,
Felix

Muhammad Yousuf Khan

unread,
Jan 22, 2014, 5:46:47 AM1/22/14
to puppet...@googlegroups.com

Thanks it resolved the issue. but i also learn something more, first i thought "<%= memoryfree %> " and other variables were directly written into the client "/etc/motd" and clients are responsible to replace the actual value with variable not puppet master.
however i was wrong. it seems like. first puppet master collect the information from all the client against these variable and then distributing it according to the value to every client node. please correct me if i am wrong.
Thanks for your help.

MYk



 
HTH,
Felix

Felix Frank

unread,
Jan 22, 2014, 5:51:10 AM1/22/14
to puppet...@googlegroups.com
Hi,

that's pretty much correct. Only to clarify, this is what happens when
the agent contacts the master:

1. the agent requests plugins (if pluginsync is enabled)
-> this may introduce new fact code to the agent
2. the agent gathers all facts about its local machine (see facter)
3. the agent sends all facts to the master, and the master can use these
during compilation, both in templates and manifests
4. the master sends a catalog, including file contents generated from
templates
5. the agent verifies that the system state is synchronous with the
catalog specification, and performs update actions if there are
discrepancies

Hope this makes sense,
Felix

Muhammad Yousuf Khan

unread,
Jan 22, 2014, 6:57:03 AM1/22/14
to puppet...@googlegroups.com
Thanks Alot :)
Reply all
Reply to author
Forward
0 new messages