On Oct 14, 2009, at 11:43 AM, Jason Antman wrote:
>
> Good Afternoon, all,
>
> I believe I posted something on this in the past, but didn't get many
> replies.
>
> I'm trying to manage some slightly different configs for different
> classes of hosts within templates using
> scope.compiler.classlist.include. Specifically, for example, all of
> our
> hosts have the same httpd.conf file, with the exception of two hosts
> (each of which have a unique class defined in them).
>
> Something like:
> <% if scope.compiler.classlist.include?("fooClass") then %>
> foo
> bar
> baz
> <% end %>
>
> I originally tried this with both the template for httpd.conf and the
> template for /etc/sysconfig/iptables.
>
> On all of the hosts that use these methods, I'm seeing some strange
> behavior where intermittently (sometimes as much as 50/50, exactly 1
> on
> 1 off) the if statement does not evaluate, and the segment of code
> within it doesn't get applied. I've looked through the logs to no
> end -
> all I can see is that these files flap back and forth endlessly,
> removing the generated file, replacing it with a new one, the
> replacing
> it with the original (the MD5 sums also reveal the A-B-A-B pattern).
>
> I'm using an external node classifier script, but have been dumping
> its'
> output to a timestamped log file, and the output is always correct
> (the
> classes in question always appear in the YAML).
>
> Any ideas?
To clarify - you're looking for a class generated by your external
node tool, and sometimes it shows up in this list and sometimes doesn't?
My guess, though, is that this is an ordering issue - the classlist is
built as classes are evaluated, and the evaluation order can change
somewhat arbitrarily.
I think we fixed a lot of this in 0.25, but really, I still don't
think it's as deterministic as it could be.
At the least, I think it's a bug that the entire class list from the
external node isn't put into the classlist variable immediately, and
I've just confirmed that it isn't - that would provide you isolation
from any ordering issues for at least those classes that come from the
external node.
Filed and fixed, to be included in 0.25.1.
--
If you can't be a good example, then you'll just have to be a
horrible warning. -- Catherine Aird
---------------------------------------------------------------------
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en
-~----------~----~----~----~------~----~------~--~---