Stasheck
2008-Apr-23 13:00 UTC
[Puppet Users] Puppet does not recognize changes in manifests
Hi, I''m rather new to Puppet, but already a fan :-) Hello everyone :-) Now, currently my config is rather basic, and I work by directly editing manifests that are used by puppet, and then using "puppetrun -- host testhost.mydomain" to try out changes. The problem is, quite often puppetd on testhost will not use the new version of manifest, but rather will stick to the old one. Example: manifest testfile: class testfile { file { "/home/testuser/test": ensure => file, mode => 660; } } after first puppetrun I have, of course, file /home/testuser/test with 660 access. But then I change testfile to: class testfile { file { "/home/testuser/test": ensure => file, mode => 640; } } and after consecutive puppetrun-s I have still 660 access. Then, couple of random manifest testfile changes later, suddenly puppetd "picks up" that a change has been made, and voila! Mode is now 640. I''m using puppet 0.24.4. Now my guess is that it''s normal behaviour, and I missed something obvious in my configuration, but I haven''t been able to find it for last two days, so here it is: my call for help. Cheers, Stanislaw --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Evan Hisey
2008-Apr-23 13:41 UTC
[Puppet Users] Re: Puppet does not recognize changes in manifests
On Wed, Apr 23, 2008 at 8:00 AM, Stasheck <stanislaw.kaminski@gmail.com> wrote:> > Hi, > I''m rather new to Puppet, but already a fan :-) Hello everyone :-) > > Now, currently my config is rather basic, and I work by directly > editing manifests that are used by puppet, and then using "puppetrun -- > host testhost.mydomain" to try out changes. > > The problem is, quite often puppetd on testhost will not use the new > version of manifest, but rather will stick to the old one. Example: > > manifest testfile: > > class testfile { > file { "/home/testuser/test": ensure => file, mode => 660; } > } > > after first puppetrun I have, of course, file /home/testuser/test with > 660 access. > > But then I change testfile to: > class testfile { > file { "/home/testuser/test": ensure => file, mode => 640; } > } > > and after consecutive puppetrun-s I have still 660 access. > > Then, couple of random manifest testfile changes later, suddenly > puppetd "picks up" that a change has been made, and voila! Mode is now > 640. > > I''m using puppet 0.24.4. > > Now my guess is that it''s normal behaviour, and I missed something > obvious in my configuration, but I haven''t been able to find it for > last two days, so here it is: my call for help. > > Cheers, > StanislawThis may not be the best solution, but I run puppet --noop site.pp to pick up any changes to the manifest when I am testing. You can also just restart/reload puppetmaster to pick up the changes. I suspect there is a better way though. Evan --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Luke Kanies
2008-Apr-23 14:59 UTC
[Puppet Users] Re: Puppet does not recognize changes in manifests
On Apr 23, 2008, at 8:00 AM, Stasheck wrote:> Then, couple of random manifest testfile changes later, suddenly > puppetd "picks up" that a change has been made, and voila! Mode is now > 640. > > I''m using puppet 0.24.4. > > Now my guess is that it''s normal behaviour, and I missed something > obvious in my configuration, but I haven''t been able to find it for > last two days, so here it is: my call for help.There doesn''t seem to be anything wrong, and the master should definitely pick up your changes, but it won''t pick them up in less than 15 seconds. That is, the server doesn''t check for changes more often than every 15 seconds. Other than that, yeah, you should see your changes. Does the client have any logs about whether it''s recompiling? Does it say anything in verbose mode about why it''s not, if it''s not? -- Always behave like a duck - keep calm and unruffled on the surface but paddle like the devil underneath. -- Jacob Braude --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Brice Figureau
2008-Apr-23 16:01 UTC
[Puppet Users] Re: Puppet does not recognize changes in manifests
On Wed, 2008-04-23 at 06:00 -0700, Stasheck wrote:> Hi, > I''m rather new to Puppet, but already a fan :-) Hello everyone :-) > > Now, currently my config is rather basic, and I work by directly > editing manifests that are used by puppet, and then using "puppetrun -- > host testhost.mydomain" to try out changes. > > The problem is, quite often puppetd on testhost will not use the new > version of manifest, but rather will stick to the old one. Example: > > [snip] > > and after consecutive puppetrun-s I have still 660 access. > > Then, couple of random manifest testfile changes later, suddenly > puppetd "picks up" that a change has been made, and voila! Mode is now > 640. > > I''m using puppet 0.24.4. > > Now my guess is that it''s normal behaviour, and I missed something > obvious in my configuration, but I haven''t been able to find it for > last two days, so here it is: my call for help.I already saw this problem (with 0.24.1 if I remember correctly) if your manifest contains a syntax error. The puppetmaster won''t reload it, but doesn''t spit an error. The error message appeared only when restarting the puppetmaster. Note that what you are observing is maybe not what I wrote above, this bug might have been corrected in the subsequent 0.24.x version. HTH, -- Brice Figureau <brice-puppet@daysofwonder.com> --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Steven Nemetz
2008-Apr-23 17:58 UTC
[Puppet Users] Problem setting variables from an external node script with puppet 0.24.4
I am in the process of converting from using the site.pp file to using an external node classifier perl script. But have run into a problem testing variables in templates that have been set via the external script. Setting a variable in the external node script (like $parameters{''su_spam''} = ''true'';) or in the site.pp file (like $su_spam = ''true'') should behave the same. But they don''t. If printed both variables look the same. But when tested with if statements in templates, the ones set in site.pp work while the ones set by the external script do not. Here is the test I just ran, setting su_spam via site.pp and su_spamprs via the external script (both set to ''true'') Template: # Testing # su_devel = ''<%= su_devel %>'' # su_spam = ''<%= su_spam %>'' # if spam== <% if su_spam == ''true'' %>true<% else %>false<% end %> # if spam=~ ^ <% if su_spam =~ /^true/ %>true<% else %>false<% end %> # if spam=~ $ <% if su_spam =~ /true$/ %>true<% else %>false<% end %> # if spam=~ ^$ <% if su_spam =~ /^true$/ %>true<% else %>false<% end %> # if spam=~ // <% if su_spam =~ /true/ %>true<% else %>false<% end %> # su_spamprs = ''<%= su_spamprs %>'' # if spamprs== <% if su_spamprs == ''true'' %>true<% else %>false<% end %> # if spamprs =~ ^ <% if su_spamprs =~ /^true/ %>true<% else %>false<% end %> # if spamprs =~ $ <% if su_spamprs =~ /true$/ %>true<% else %>false<% end %> # if spamprs =~ ^$ <% if su_spamprs =~ /^true$/ %>true<% else %>false<% end %> # if spamprs =~ // <% if su_spamprs =~ /true/ %>true<% else %>false<% end %> # Results: # Testing # su_devel = ''false'' # su_spam = ''true'' # if spam== true # if spam=~ ^ true # if spam=~ $ true # if spam=~ ^$ true # if spam=~ // true # su_spamprs = ''true'' # if spamprs== false # if spamprs =~ ^ false # if spamprs =~ $ false # if spamprs =~ ^$ false # if spamprs =~ // false # Has anyone seen this behavior or have a work around? It appears that variables read from an external script are not defined correctly. But I haven''t found how yet. Still new to ruby, so I haven''t gotten too deep in this yet. Running 0.24.4 on both server and client. Server is on Ubuntu 7.10 and client is CentOs 5 Thanks, Steven --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Steven Nemetz
2008-Apr-23 18:34 UTC
[Puppet Users] Re: Problem setting variables from an external node script with puppet 0.24.4
Found the problem and entered a bug ticket for it. Turns out the variables defined in a manifest are of class ''String'', but variables defined from an external script are of class ''TrueClass''. This broke all comparisons, since TrueClass need to be converted to a string before doing string comparisons.> -----Original Message----- > From: puppet-users@googlegroups.com[mailto:puppet-users@googlegroups.com]> On Behalf Of Steven Nemetz > Sent: Wednesday, April 23, 2008 10:58 AM > To: puppet-users@googlegroups.com > Subject: [Puppet Users] Problem setting variables from an externalnode> script with puppet 0.24.4 > > > > I am in the process of converting from using the site.pp file to using > an external node classifier perl script. But have run into a problem > testing variables in templates that have been set via the external > script. > > Setting a variable in the external node script (like > $parameters{''su_spam''} = ''true'';) or in the site.pp file (like$su_spam> = ''true'') should behave the same. But they don''t. > > If printed both variables look the same. But when tested with if > statements in templates, the ones set in site.pp work while the onesset> by the external script do not. > > Here is the test I just ran, setting su_spam via site.pp andsu_spamprs> via the external script (both set to ''true'') > > Template: > > # Testing > # su_devel = ''<%= su_devel %>'' > # su_spam = ''<%= su_spam %>'' > # if spam== <% if su_spam == ''true'' %>true<% else %>false<% end %> > # if spam=~ ^ <% if su_spam =~ /^true/ %>true<% else %>false<% end %> > # if spam=~ $ <% if su_spam =~ /true$/ %>true<% else %>false<% end %> > # if spam=~ ^$ <% if su_spam =~ /^true$/ %>true<% else %>false<% end%>> # if spam=~ // <% if su_spam =~ /true/ %>true<% else %>false<% end %> > # su_spamprs = ''<%= su_spamprs %>'' > # if spamprs== <% if su_spamprs == ''true'' %>true<% else %>false<% end%>> # if spamprs =~ ^ <% if su_spamprs =~ /^true/ %>true<% else %>false<% > end %> > # if spamprs =~ $ <% if su_spamprs =~ /true$/ %>true<% else %>false<% > end %> > # if spamprs =~ ^$ <% if su_spamprs =~ /^true$/ %>true<% else%>false<%> end %> > # if spamprs =~ // <% if su_spamprs =~ /true/ %>true<% else %>false<% > end %> > # > > Results: > > # Testing > # su_devel = ''false'' > # su_spam = ''true'' > # if spam== true > # if spam=~ ^ true > # if spam=~ $ true > # if spam=~ ^$ true > # if spam=~ // true > # su_spamprs = ''true'' > # if spamprs== false > # if spamprs =~ ^ false > # if spamprs =~ $ false > # if spamprs =~ ^$ false > # if spamprs =~ // false > # > > Has anyone seen this behavior or have a work around? > > It appears that variables read from an external script are not defined > correctly. But I haven''t found how yet. Still new to ruby, so Ihaven''t> gotten too deep in this yet. > > Running 0.24.4 on both server and client. Server is on Ubuntu 7.10 and > client is CentOs 5 > > Thanks, > Steven > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Stasheck
2008-Apr-24 06:38 UTC
[Puppet Users] Re: Puppet does not recognize changes in manifests
On Apr 23, 6:01 pm, Brice Figureau <brice-pup...@daysofwonder.com> wrote:> On Wed, 2008-04-23 at 06:00 -0700, Stasheck wrote: > > Hi, > > I''m rather new to Puppet, but already a fan :-) Hello everyone :-) > > > Now, currently my config is rather basic, and I work by directly > > editing manifests that are used by puppet, and then using "puppetrun -- > > host testhost.mydomain" to try out changes. > > > The problem is, quite often puppetd on testhost will not use the new > > version of manifest, but rather will stick to the old one. Example: > > > [snip] > > > and after consecutive puppetrun-s I have still 660 access. > > > Then, couple of random manifest testfile changes later, suddenly > > puppetd "picks up" that a change has been made, and voila! Mode is now > > 640. > > > I''m using puppet 0.24.4. > > > Now my guess is that it''s normal behaviour, and I missed something > > obvious in my configuration, but I haven''t been able to find it for > > last two days, so here it is: my call for help. > > I already saw this problem (with 0.24.1 if I remember correctly) if your > manifest contains a syntax error. The puppetmaster won''t reload it, but > doesn''t spit an error. The error message appeared only when restarting > the puppetmaster. > Note that what you are observing is maybe not what I wrote above, this > bug might have been corrected in the subsequent 0.24.x version. > > HTH, > -- > Brice Figureau <brice-pup...@daysofwonder.com>Yes, that could be my situation - I mean, I make an error in manifest, pmaster throws info in log, but when I correct this error, nothing happens, as if the file was not read again, but like pmaster "remembered" about this error. How can I test if that''s the case? Cheers, Stanislaw --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Ohad Levy
2008-Apr-24 12:55 UTC
[Puppet Users] Re: Puppet does not recognize changes in manifests
I made a habit of using pupet --parseonly after everytime I modify a manifest file... saves a lot of time debuging... if you got used using a version control system, its also a good idea to put it as a precommit hook script. Cheers, Ohad On Thu, Apr 24, 2008 at 2:38 PM, Stasheck <stanislaw.kaminski@gmail.com> wrote:> > On Apr 23, 6:01 pm, Brice Figureau <brice-pup...@daysofwonder.com> > wrote: > > On Wed, 2008-04-23 at 06:00 -0700, Stasheck wrote: > > > Hi, > > > I''m rather new to Puppet, but already a fan :-) Hello everyone :-) > > > > > Now, currently my config is rather basic, and I work by directly > > > editing manifests that are used by puppet, and then using "puppetrun -- > > > host testhost.mydomain" to try out changes. > > > > > The problem is, quite often puppetd on testhost will not use the new > > > version of manifest, but rather will stick to the old one. Example: > > > > > [snip] > > > > > and after consecutive puppetrun-s I have still 660 access. > > > > > Then, couple of random manifest testfile changes later, suddenly > > > puppetd "picks up" that a change has been made, and voila! Mode is now > > > 640. > > > > > I''m using puppet 0.24.4. > > > > > Now my guess is that it''s normal behaviour, and I missed something > > > obvious in my configuration, but I haven''t been able to find it for > > > last two days, so here it is: my call for help. > > > > I already saw this problem (with 0.24.1 if I remember correctly) if your > > manifest contains a syntax error. The puppetmaster won''t reload it, but > > doesn''t spit an error. The error message appeared only when restarting > > the puppetmaster. > > Note that what you are observing is maybe not what I wrote above, this > > bug might have been corrected in the subsequent 0.24.x version. > > > > HTH, > > -- > > Brice Figureau <brice-pup...@daysofwonder.com> > > Yes, that could be my situation - I mean, I make an error in manifest, > pmaster throws info in log, but when I correct this error, nothing > happens, as if the file was not read again, but like pmaster > "remembered" about this error. > > How can I test if that''s the case? > > Cheers, > Stanislaw > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---