Vipul Ramani
2008-Sep-30 21:41 UTC
[Puppet Users] something wrong with puppet client or Server
Hi All, I have running puppet client and server on solaris 10 x86. Now days some of puppet client behaviors is something weird !!! or May be i am missing something... for ex. I created class to add one line in /etc/vfstab . but puppet client did it successfully 1st time ...But .. After few days , i saw there are same line has been added more than 250 times.. [ see same line is added so many times ] I dont understand if once it is already added line in /etc/fstab why it is adding every time.... ----------------------logadd.pp------------------ class logadd { file { "/tmp/logadd.sh": ensure => present, mode => 755, owner => root, group => sys, source => "puppet://test1t/files/common//logadd.sh" } exec { "sh /tmp/logadd.sh": path => "/usr/bin:/sbin:/bin:/usr/sbin" } } ------------------------------ bash-3.2# cat logadd.sh mkdir /mnt/logadd echo ''zfs22x:/test/logadd - /mnt/logadd nfs - yes intr,vers=3'' >> /etc/vfstab mountall #cat /etc/vfstab ---removed / boot/ ---- zfs22x:/test/logadd - /mnt/logadd nfs - yes intr,vers=3 zfs22x:/test/logadd - /mnt/logadd nfs - yes intr,vers=3 zfs22x:/test/logadd - /mnt/logadd nfs - yes intr,vers=3 zfs22x:/test/logadd - /mnt/logadd nfs - yes intr,vers=3 zfs22x:/test/logadd - /mnt/logadd nfs - yes intr,vers=3 zfs22x:/test/logadd - /mnt/logadd nfs - yes intr,vers=3 zfs22x:/test/logadd - /mnt/logadd nfs - yes intr,vers=3 zfs22x:/test/logadd - /mnt/logadd nfs - yes intr,vers=3 zfs22x:/test/logadd - /mnt/logadd nfs - yes intr,vers=3 zfs22x:/test/logadd - /mnt/logadd nfs - yes intr,vers=3 zfs22x:/test/logadd - /mnt/logadd nfs - yes intr,vers=3 zfs22x:/test/logadd - /mnt/logadd nfs - yes intr,vers=3 thanks in adv .... Regards Vipul Ramani ~~~ FrEE Ur M1nd ~~~~ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
Peter Meier
2008-Sep-30 21:46 UTC
[Puppet Users] Re: something wrong with puppet client or Server
Hi> I dont understand if once it is already added line in /etc/fstab why > it is adding every time....because you have never defined how it knows then it''s added. this is the expected behaviour of puppet. greets pete --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
Andrew Shafer
2008-Sep-30 21:50 UTC
[Puppet Users] Re: something wrong with puppet client or Server
Exec is not going to be idempotent unless you add the logic. You told Puppet to run that script every time, which adds the line. On Tue, Sep 30, 2008 at 3:46 PM, Peter Meier <peter.meier@immerda.ch> wrote:> > Hi > > > I dont understand if once it is already added line in /etc/fstab why > > it is adding every time.... > > because you have never defined how it knows then it''s added. > this is the expected behaviour of puppet. > > greets pete > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
AJ Christensen
2008-Sep-30 21:52 UTC
[Puppet Users] Re: something wrong with puppet client or Server
Best. Non-idempotent. Exec. Ever. unless => "/bin/grep ''my line'' /etc/vfstab" in your exec{}. Regards, AJ 2008/10/1 Andrew Shafer <andrew@reductivelabs.com>> Exec is not going to be idempotent unless you add the logic. > > You told Puppet to run that script every time, which adds the line. > > > On Tue, Sep 30, 2008 at 3:46 PM, Peter Meier <peter.meier@immerda.ch>wrote: > >> >> Hi >> >> > I dont understand if once it is already added line in /etc/fstab why >> > it is adding every time.... >> >> because you have never defined how it knows then it''s added. >> this is the expected behaviour of puppet. >> >> greets pete >> >> >> > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
Vipul Ramani
2008-Sep-30 22:02 UTC
[Puppet Users] Re: something wrong with puppet client or Server
WOW make sense !!! thanks for answer !!! that awesome .. But i have never seen " unless ==> " in documentation or recipe .. so ... let me try ... On Sep 30, 2:52 pm, "AJ Christensen" <a...@junglist.gen.nz> wrote:> Best. Non-idempotent. Exec. Ever. > unless => "/bin/grep ''my line'' /etc/vfstab" in your exec{}. > > Regards, > > AJ > > 2008/10/1 Andrew Shafer <and...@reductivelabs.com> > > > Exec is not going to be idempotent unless you add the logic. > > > You told Puppet to run that script every time, which adds the line. > > > On Tue, Sep 30, 2008 at 3:46 PM, Peter Meier <peter.me...@immerda.ch>wrote: > > >> Hi > > >> > I dont understand if once it is already added line in /etc/fstab why > >> > it is adding every time.... > > >> because you have never defined how it knows then it''s added. > >> this is the expected behaviour of puppet. > > >> greets pete--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
Mike Renfro
2008-Sep-30 22:14 UTC
[Puppet Users] Re: something wrong with puppet client or Server
On 9/30/2008 5:02 PM, Vipul Ramani wrote:> thanks for answer !!! that awesome .. But i have never seen " unless > ==> " in documentation or recipe .. so ...http://reductivelabs.com/trac/puppet/wiki/TypeReference#exec has it. And it also has: It is critical that all commands executed using this mechanism can be run multiple times without harm, i.e., they are idempotent. One useful way to create idempotent commands is to use the checks like creates to avoid running the command unless some condition is met. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
Vipul Ramani
2008-Sep-30 22:22 UTC
[Puppet Users] Re: something wrong with puppet client or Server
WOW thanks MIKE , Sorry then i did not read properly ... but anyways thanks for all ... For super sonic faster response !!!! On Sep 30, 3:14 pm, Mike Renfro <ren...@tntech.edu> wrote:> On 9/30/2008 5:02 PM, Vipul Ramani wrote: > > > thanks for answer !!! that awesome .. But i have never seen " unless > > ==> " in documentation or recipe .. so ... > > http://reductivelabs.com/trac/puppet/wiki/TypeReference#exechas it. And > it also has: > > It is critical that all commands executed using this mechanism can be > run multiple times without harm, i.e., they are idempotent. One useful > way to create idempotent commands is to use the checks like creates to > avoid running the command unless some condition is met.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---