Jira (PUP-4412) Allow automatic parameter lookups to collect metaparameters
Title: Message Title Matt Schuchard commented on PUP-4412 Re: Allow automatic parameter lookups to collect metaparameters Thanks for all the ideas and algorithms, These were very helpful. Add Comment This message was sent by Atlassian JIRA (v6.4.13#64028-sha1:b7939e9) -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com. To post to this group, send email to puppet-bugs@googlegroups.com. Visit this group at https://groups.google.com/group/puppet-bugs. For more options, visit https://groups.google.com/d/optout.
Jira (PUP-4412) Allow automatic parameter lookups to collect metaparameters
Title: Message Title Henrik Lindberg commented on PUP-4412 Re: Allow automatic parameter lookups to collect metaparameters The suggested "combine" function (not sure about the name though) is a useful general purpose function that would fit in stdlib. Add Comment This message was sent by Atlassian JIRA (v6.4.13#64028-sha1:b7939e9) -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com. To post to this group, send email to puppet-bugs@googlegroups.com. Visit this group at https://groups.google.com/group/puppet-bugs. For more options, visit https://groups.google.com/d/optout.
Jira (PUP-4412) Allow automatic parameter lookups to collect metaparameters
Title: Message Title Matt Schuchard commented on PUP-4412 Re: Allow automatic parameter lookups to collect metaparameters Would this be a worthwhile addition to stdlib? I assume that function is too esoteric for a Puppet intrinsic. Add Comment This message was sent by Atlassian JIRA (v6.4.13#64028-sha1:b7939e9) -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com. To post to this group, send email to puppet-bugs@googlegroups.com. Visit this group at https://groups.google.com/group/puppet-bugs. For more options, visit https://groups.google.com/d/optout.
Jira (PUP-4412) Allow automatic parameter lookups to collect metaparameters
Title: Message Title Matt Schuchard commented on PUP-4412 Re: Allow automatic parameter lookups to collect metaparameters Only just noticed your new suggestion, but I will give that a shot after I fully understand the lambda as the suggestion seems quite good. I am also doing something similar with a custom function that establishes the require metaparameter iteratively for a hash of package resources. I think your suggestion will be useful for that also since with stdlib I am still getting an array via: keys($pkg_hash).each Thanks for the followup. Add Comment This message was sent by Atlassian JIRA (v6.4.12#64027-sha1:e3691cc) -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com. To post to this group, send email to puppet-bugs@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-bugs. For more options, visit https://groups.google.com/d/optout.
Jira (PUP-4412) Allow automatic parameter lookups to collect metaparameters
Title: Message Title Henrik Lindberg commented on PUP-4412 Re: Allow automatic parameter lookups to collect metaparameters You can use the reduce function to transform an array of number to an array of tuples. Here is how: notice [1,2,3,4].reduce |$m,$e| { if $m =~ Integer { [[$m, $e]] } else { $m << [$m[-1][-1], $e] } } Which, if you are using a late puppet 4.x can be written as a puppet function {code:puppet}
Jira (PUP-4412) Allow automatic parameter lookups to collect metaparameters
Title: Message Title Matt Schuchard commented on PUP-4412 Re: Allow automatic parameter lookups to collect metaparameters I forgot to mention I took the above suggestion and ran with it doing: hiera_array($catalog).each |$index, $class| { if $index 0 { Class[hiera_array($catalog)[$index - 1]] - Class[$class] } } for an iterative set of classes where $catalog is the array of classes pulled from the hiera ENC via hiera_include. So if you guys find this general functionality interesting then go with it but Henrik's comment lead me to the functionality I required. Add Comment This message was sent by Atlassian JIRA (v6.3.15#6346-sha1:dbc023d) -- You received this message because you are subscribed to the Google Groups Puppet Bugs group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com. To post to this group, send email to puppet-bugs@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-bugs. For more options, visit https://groups.google.com/d/optout.
Jira (PUP-4412) Allow automatic parameter lookups to collect metaparameters
Title: Message Title Henrik Lindberg commented on PUP-4412 Re: Allow automatic parameter lookups to collect metaparameters Matt Schuchard If you encoded the information as an array (seems so), then you can do this a better way: hiera_array($catalog).slice(2) |$from, $to] { Class[$from] - Class[$to] } As you otherwise have to either lookup $catalog with hiera_array each time in the loop, or to hold that result in a variable. It is also much easier to read . The slice function simply feeds each slice of the original array splatted onto the parameters of the code block. Add Comment This message was sent by Atlassian JIRA (v6.3.15#6346-sha1:dbc023d) -- You received this message because you are subscribed to the Google Groups Puppet Bugs group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com. To post to this group, send email to puppet-bugs@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-bugs. For more options, visit https://groups.google.com/d/optout.
Jira (PUP-4412) Allow automatic parameter lookups to collect metaparameters
Title: Message Title Owen Rodabaugh updated an issue Puppet / PUP-4412 Allow automatic parameter lookups to collect metaparameters Change By: Owen Rodabaugh CS Priority: NeedsPriority Trivial Add Comment This message was sent by Atlassian JIRA (v6.3.15#6346-sha1:dbc023d) -- You received this message because you are subscribed to the Google Groups Puppet Bugs group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com. To post to this group, send email to puppet-bugs@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-bugs. For more options, visit https://groups.google.com/d/optout.
Jira (PUP-4412) Allow automatic parameter lookups to collect metaparameters
Title: Message Title Henrik Lindberg commented on PUP-4412 Re: Allow automatic parameter lookups to collect metaparameters There are a number of metaparameters and only a few of them are ever used and set. Automatically looking up all of them for every class would have a performance penalty (increasing the number of lookups by something like 10 x the number of classes). Lookups are expensive. There is also the question about what missing means for some of the parameters; missing in the class/resource definition, or missing in the catalog (e.g. setting a dependency via one of the dependency operators , , or at the other end of the dependency, or via overrides). The final value of some meta parameters are computed lazily (at the end of the compilation). With future parser it should be easy to store relationships under a key, say relationships and then iterate over that. e.g. relationships: - [ mymodule::testclass, mymodule::otherclass] - [ ... ] And then do this at the end of the compilation: hiera_array('relationships').each |$pair| { $pair[0] - $pair[1] } There are other possibilities as well if the classes where it is of value to set metaparameters can be modified. The above (using relationships) leaves all classes unmodified.
Jira (PUP-4412) Allow automatic parameter lookups to collect metaparameters
Title: Message Title Lindsey Smith moved an issue Puppet / PUP-4412 Allow automatic parameter lookups to collect metaparameters Change By: Lindsey Smith Key: ENTERPRISE PUP - 629 4412 Project: Puppet Enterprise Add Comment This message was sent by Atlassian JIRA (v6.3.15#6346-sha1:dbc023d) -- You received this message because you are subscribed to the Google Groups Puppet Bugs group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com. To post to this group, send email to puppet-bugs@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-bugs. For more options, visit https://groups.google.com/d/optout.