On Nov 13, 2008, at 2:21 AM, schickb wrote:
>
> I''ve found that it would simplify my configuration scripts if I
had a
> way to influence the order of operations beyond strict dependencies.
> For example, I had to define a "group" instance with a hard-coded
gid
> and wanted the change to run before most other tasks to avoid
> collisions with automatically generated groups. It was fairly tedious
> to make lots of "package" instances require that group instance.
I
> could simplify this with defines, but that still would require lot of
> code changes since I realized it after lots of work was done.
>
> I think a cleaner solution would be a way to push operation towards
> the start or end of a run. For example, if I could say:
>
> type { "name":
> require => "head", # or tail
> }
>
> Then puppet would put the task as close to the first (or last)
> operation as possible while still honoring all explicit dependencies.
> Multiple "heads" would be ordered randomly.
>
> Or you could make it even richer with a numeric metaparameter called
> "priority". Positive priorities would try to get close to the
first
> operation (again after explicit dependencies are honored), while
> negative priorities would try to get close to the last operation.
There have been multiple discussions about this, and there are
multiple feature requests opened for it. We still don''t have a clean
solution, but with the discussions with Brice and others about
remodeling the querying syntax to make this feasible. You''d do
something like:
Package { require => Group[foo] }
to have all of your packages require that group.
I''ve also thought about adding something like what you''re
talking
about, where you could push a given resource to the beginning or end
of the sorted list, but I don''t really have a good way to do that.
The best I can think of is to have some parameter (e.g., something
like your priority) that affected the sort order of otherwise-
equivalent resources. I don''t really know how well this would work,
but I''m amenable if someone can come up with a clean design.
--
Don''t throw away the old bucket until you know whether the new one
holds water. -- Swedish Proverb
---------------------------------------------------------------------
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
-~----------~----~----~----~------~----~------~--~---