On Monday, July 2, 2012 3:42:34 PM UTC-5, Jeremy Carroll wrote:
During DevOpsDays it was brought up that there may be a patch for ordered
hashes with Hiera. Without this patch, all of my catalogs are compiled in
random order. Any links to a patch that I can back-port, or a commit #?
I know nothing about the Hiera modifications you are asking about, but I
would like to suggest that you consider writing classes so that they are
insensitive to the order they are declared. A manifest set written in this
way is much more resilient and easier to maintain than one that requires *
you* to find a suitable order in which to declare classes. It's good no
matter what mechanism you use to declare classes (direct, hiera, ENC, ...).
This is entirely possible -- not even all that hard -- provided that you
avoid the parametrized-class syntax for declaring classes, and instead use
good old 'include' (or 'require'). You must also avoid constructs that are
inherently parse-order dependent, most notably using the 'defined' function
to determine whether a class has been declared for the target node. Then
have every class start by 'include'ing each other class on which it has
direct parse-order dependencies, and you should be good to go.
Avoiding parametrized-class declaration syntax has always been a good
idea. Even if using external data (e.g. from hiera) were not a technically
superior design, Puppet's parametrized class declaration syntax has serious
technical problems attending it (not least that it does not in general
allow classes to declare their dependencies). Puppet 3 ties class
parameters to hiera, which provides a way forward for shops that have
invested heavily in class parametrization. It also has documentary and
convenience advantages.
John