Re: [Puppet Users] extlookup in 2.6.1 defaults

Douglas Garstang
2010-08-22T08:36:31Z

On Sun, Aug 22, 2010 at 12:20 AM, Douglas Garstang
<doug.garstang@gmail.com> wrote:
> On Sun, Aug 22, 2010 at 12:02 AM, Joe McDonagh
> <joseph.e.mcdonagh@gmail.com> wrote:
>> On 08/22/2010 02:42 AM, Douglas Garstang wrote:
>>
>>>
>>> This seems a bit weird to me. The second parameter isn''t
optional (I
>>> think the 2nd and 3rd parameters should be switched), which means
that
>>> you MUST have a default value in there, which means, you might as
well
>>> use the same value as in the file, which means the file is somewhat
>>> redundant. Anyone else see that?
>>>
>>> Doug.
>>>
>>
>> extlookup has always supported defaults, which were always optional. A
>> cursory look of the current code appears that it''s also still
an optonal
>> default.
>
> Hmmm, I''m too tired to try that again, but the next problem is
that I
> want to be able to put these defaults in external files, but ALWAYS
> override them with the value passed from an external node. It''s
more
> specific after all. However, extlookup doesn''t work like that. It
only
> uses the default passed directly to extlookup when it''s NOT in the
> files, therefore giving the files precedence.
>
> Doug.
>

Oh sweet....

    jboss::instance {
        tfel0:
            version                 => $jboss_version,
            naming_port             => 1099,
            cluster                 => "c0tfel0",
            java_heap_min           => $tfel0_elementsJBossHeapMin ? {
"" => extlookup("tfel0_elementsJBossHeapMin",
extlookup("elementsJBossHeapMin", "",
"appDefaults") ), default =>
"${tfel0_elementsJBossHeapMin}" },

cascading defaults! Wooo!