Hmmm.... So I was just trying the extlookup function that comes with puppet 2.6.1. It now lets you do this: $version = extlookup("rsyslog_version", "present", "packages") which, according to the documentation: # This will look for a version configured in packages.csv and then in the rest as configured # by $extlookup_precedence if it''s not found anywhere it will default to "present", this kind # of use case makes puppet a lot nicer for managing large amounts of packages since you do not # need to edit a load of manifests to do simple things like adjust a desired version number. 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. -- 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.
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. -- Joe McDonagh AIM: YoosingYoonickz IRC: joe-mac on freenode L''ennui est contre-révolutionnaire -- 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.
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. -- 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.
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! Doug. -- 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.
Apparently Analagous Threads
- extlookup not working correctly in 2.7.6
- Puppet environment can't be used in extlookup (precedence)
- Thoughts about extlookup: http://blog.wl0.org/2011/05/thoughts-about-extlookup-in-puppet/
- Using regex to match hostnames in hiera
- undefined method `function_extlookup'