I am still using extlookup with Puppet 2.7.19 - I will not be upgrading to 
3.0 and Hiera until closer to Christmas (sorry).

What I was looking to do was use extlookup to retrieve some values using a 
particular setting of $extlookup_precedence and then using those values to 
set $extlookup_precedence later.  As variables can not be changed once 
assigned I wrote a class to do this however it does not seem to work. 

For example, a simple example in my site.pp fails (being unable to find any 
mention of role via extlookup):

$extlookup_datadir = "/etc/puppet/manifests/extdata"

class test

        $extlookup_precedence = [ "nodes/%{hostname}" ]

        $role = extlookup("role")
}

include test

notify {"Role: $test::role": }


However if the code in class test is merely transplanted into the global 
scope it works fine (e,g, role can now be found even though only the scope 
has changed).

Is it that extlookup only looks at the global scope for 
$extlookup_precedence and therefore there is no way to effectively reassign 
this variable based on previously retrieved values?

Thanks in advance ...

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-users/-/Egh4ZLdXk60J.
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.

Reply via email to