Puppet does not recognize changes in manifests

1,350 views
Skip to first unread message

Stasheck

unread,
Apr 23, 2008, 9:00:54 AM4/23/08
to Puppet Users
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

Evan Hisey

unread,
Apr 23, 2008, 9:41:55 AM4/23/08
to puppet...@googlegroups.com
This 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

Luke Kanies

unread,
Apr 23, 2008, 10:59:21 AM4/23/08
to puppet...@googlegroups.com
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

Brice Figureau

unread,
Apr 23, 2008, 12:01:15 PM4/23/08
to puppet...@googlegroups.com
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-...@daysofwonder.com>

Steven Nemetz

unread,
Apr 23, 2008, 1:58:19 PM4/23/08
to puppet...@googlegroups.com

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

Steven Nemetz

unread,
Apr 23, 2008, 2:34:07 PM4/23/08
to puppet...@googlegroups.com
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.

Stasheck

unread,
Apr 24, 2008, 2:38:25 AM4/24/08
to Puppet Users
On Apr 23, 6:01 pm, Brice Figureau <brice-pup...@daysofwonder.com>
wrote:
> 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

Ohad Levy

unread,
Apr 24, 2008, 8:55:17 AM4/24/08
to puppet...@googlegroups.com
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
Reply all
Reply to author
Forward
0 new messages