Tiago Cruz
2013-Feb-14 12:02 UTC
[Puppet Users] Why a "execute" command show as "changed" on Dashboard?
Hello, I''m using the puppet-dashboard-1.2.10 and I''ve noticed that I have too much "Changed" hosts, but this is not true. This is only hosts running "exec" commands, like: notice> executed successfully > /Stage[main]/Executecron/Exec[crontab_backup]/returns > /etc/puppet/manifests/crontab.ppWhich is some like this: command => "/usr/bin/crontab -l > /movile/crontab/root_$hostname.txt", So, why this happen? Can I avoid this? Thanks!! -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
d.o.kip@cri-service.nl
2013-Feb-14 12:30 UTC
[Puppet Users] Re: Why a "execute" command show as "changed" on Dashboard?
You are creating a ''new'' file every time(well new content), so in essence, it is true that the configuration has changed. To avoid this, you should make your command smarter and make sure it only runs when changes are in the crontab. There is no need to make a backup of something that has not changed. It would probably be even better to just manage the file itself in puppet, giving you complete control over it, and not needing a backup anymore. Also, creating backups by using puppet is not really good practise. Puppet is good at setting up a configuration, and should be about resources coming to a defined state, not about being a job scheduler. In short, there is no ''normal'' way around abnormal use of Puppet ;) But of course workarounds are possible. //Danny. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Tiago Cruz
2013-Feb-14 12:59 UTC
[Puppet Users] Re: Why a "execute" command show as "changed" on Dashboard?
Hello Danny, nice explanation, thank you!!! I agree with you, this is really a "new" file everytime. So let''s try another example: exec { "authconfig":> command => "authconfig-tui --ldapserver=ldap://ldap.com > --ldapbasedn=dc=bla,dc=com --enableshadow --enablemd5 --enableldap > --enableldapauth --disableldaptls --enablelocauthorize --kickstart", > path => "/usr/bin/:/bin/:/usr/sbin", > onlyif => "fgrep ldap.com /etc/ldap.conf", > }The idea is the same: Just do the configuration if was needed, but when I look the report, I got: Log LevelMessageSourceFileLineTimenoticeexecuted successfully /Stage[main]/Base::Ldap/Exec[authconfig]/returns /etc/puppet/modules/base/manifests/ldap.pp362013-02-14 10:38 BRSTnoticeFinished catalog run in 7.56 secondsPuppet2013-02-14 10:38 BRST What can I do to workaround this? :D Thanks!! Em quinta-feira, 14 de fevereiro de 2013 10h30min45s UTC-2, d.o...@cri-service.nl escreveu:> > You are creating a ''new'' file every time(well new content), so in essence, > it is true that the configuration has changed. > > To avoid this, you should make your command smarter and make sure it only > runs when changes are in the crontab. There is no need to make a backup of > something that has not changed. > > It would probably be even better to just manage the file itself in puppet, > giving you complete control over it, and not needing a backup anymore. > > Also, creating backups by using puppet is not really good practise. Puppet > is good at setting up a configuration, and should be about resources coming > to a defined state, not about being a job scheduler. > > In short, there is no ''normal'' way around abnormal use of Puppet ;) But of > course workarounds are possible. > > //Danny. > > > >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
David Schmitt
2013-Feb-14 13:09 UTC
Re: [Puppet Users] Re: Why a "execute" command show as "changed" on Dashboard?
On 14.02.2013 13:59, Tiago Cruz wrote:> Hello Danny, nice explanation, thank you!!! > > I agree with you, this is really a "new" file everytime. So let''s try > another example: > > exec { "authconfig": > command => "authconfig-tui --ldapserver=ldap://ldap.com > --ldapbasedn=dc=bla,dc=com --enableshadow --enablemd5 --enableldap > --enableldapauth --disableldaptls --enablelocauthorize --kickstart", > path => "/usr/bin/:/bin/:/usr/sbin", > onlyif => "fgrep ldap.com /etc/ldap.conf", > } > > > The idea is the same: Just do the configuration if was needed, but when > I look the report, I got: > > > Log > > Level Message Source File Line Time > |notice| |executed successfully| > |/Stage[main]/Base::Ldap/Exec[authconfig]/returns| > |/etc/puppet/modules/base/manifests/ldap.pp| |36| |2013-02-14 10:38 BRST| > |notice| |Finished catalog run in 7.56 seconds| |Puppet| || || > |2013-02-14 10:38 BRST| > > > What can I do to workaround this? :DThe message means that the authconfig-tui command is run *every time* puppet runs. This does not seem to be your intention. I guess, you should write "unless => [ldap is configured]" instead of "onlyif => [ldap is configured]" Best Regards, David> > Thanks!! > > > Em quinta-feira, 14 de fevereiro de 2013 10h30min45s UTC-2, > d.o...@cri-service.nl escreveu: > > You are creating a ''new'' file every time(well new content), so in > essence, it is true that the configuration has changed. > > To avoid this, you should make your command smarter and make sure it > only runs when changes are in the crontab. There is no need to make > a backup of something that has not changed. > > It would probably be even better to just manage the file itself in > puppet, giving you complete control over it, and not needing a > backup anymore. > > Also, creating backups by using puppet is not really good practise. > Puppet is good at setting up a configuration, and should be about > resources coming to a defined state, not about being a job scheduler. > > In short, there is no ''normal'' way around abnormal use of Puppet ;) > But of course workarounds are possible. > > //Danny. > > > > -- > You received this message because you are subscribed to the Google > Groups "Puppet Users" group. > To unsubscribe from this group and stop receiving emails from it, send > an email to puppet-users+unsubscribe@googlegroups.com. > To post to this group, send email to puppet-users@googlegroups.com. > Visit this group at http://groups.google.com/group/puppet-users?hl=en. > For more options, visit https://groups.google.com/groups/opt_out. > >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Tiago Cruz
2013-Feb-14 13:28 UTC
Re: [Puppet Users] Re: Why a "execute" command show as "changed" on Dashboard?
Hei David, thank you! Dashboard running like a boss, thanks to you guys! Nice!! Em quinta-feira, 14 de fevereiro de 2013 11h09min27s UTC-2, David Schmitt escreveu:> > > The message means that the authconfig-tui command is run *every time* > puppet runs. This does not seem to be your intention. I guess, you > should write "unless => [ldap is configured]" instead of "onlyif => > [ldap is configured]" > >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.