Jira (PUP-9714) Add support for nested hiera interpolation
Title: Message Title Maggie Dreyer commented on PUP-9714 Re: Add support for nested hiera interpolation In general, we are not prioritizing any Hiera features for the time being. If that changes, we can revisit this. Add Comment This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935) -- 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 view this discussion on the web visit https://groups.google.com/d/msgid/puppet-bugs/JIRA.309648.1558477577000.89945.1606938120029%40Atlassian.JIRA.
Jira (PUP-9714) Add support for nested hiera interpolation
Title: Message Title Robert August Vincent II commented on PUP-9714 Re: Add support for nested hiera interpolation There needs to be a docs change, as well. Add Comment This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93) -- 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. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-bugs/JIRA.309648.1558477577000.31637.1559582280632%40Atlassian.JIRA. For more options, visit https://groups.google.com/d/optout.
Jira (PUP-9714) Add support for nested hiera interpolation
Title: Message Title Henrik Lindberg commented on PUP-9714 Re: Add support for nested hiera interpolation I would much rather see that the requested feature is solved via use of a lookup_key kind of function than modifying hiera's interpolation to do nested interpolation. Add Comment This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93) -- 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. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-bugs/JIRA.309648.1558477577000.25078.1559144340649%40Atlassian.JIRA. For more options, visit https://groups.google.com/d/optout.
Jira (PUP-9714) Add support for nested hiera interpolation
Title: Message Title Henrik Lindberg commented on PUP-9714 Re: Add support for nested hiera interpolation The above could be turned into a "key mapper" function. A user of the function would specify "path" to a data file, and the data file would contain the key mapping: --- hostgroup_specific_root_password: %{facts.hostgroup}_root_password' The function would read the data file given to the function in options[path], using a read_yaml function. It can then cache this result using the $context cache methods. On a lookup, it gets the data from the cache, if the key being looked up is present (e.g. 'hostgroup_specific_root_password'), it gets the value and calls $context.interpolate to interpolate it. This forms the new key, which it then uses in a call to lookup - the returned value from lookup is returned from the function. This generalized version would only be a couple of lines longer than the first example. Add Comment This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)
Jira (PUP-9714) Add support for nested hiera interpolation
Title: Message Title Henrik Lindberg commented on PUP-9714 Re: Add support for nested hiera interpolation Here is an example of how the same can be achieved with hiera 5 and a simple backend function written in Puppet Language. # Do whatever is needed for a special key here that interpolates a value to form another key that is looked up. # This example is hardcoded for one key only, but could easily read data from a file, support multiple keys etc. # function mymodule::special_key(Variant[String, Numeric] $key, Hash $options, Puppet::LookupContext $context) { unless $key == 'hostgroup_specific_root_password' { $context.not_found() # will return from this function } lookup("${facts[hostgroup]}_root_password") } Then add that function to hiera.yaml as a lookup_key kind of function, and use hiera regular interpolation in the data to get that key into the value of a hash. Using the example in the description this is what is in the data where the special value is wanted: ---
Jira (PUP-9714) Add support for nested hiera interpolation
Title: Message Title Josh Cooper updated an issue Puppet / PUP-9714 Add support for nested hiera interpolation Change By: Josh Cooper Team: Server Add Comment This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93) -- 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. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-bugs/JIRA.309648.1558477577000.22502.1559064301405%40Atlassian.JIRA. For more options, visit https://groups.google.com/d/optout.
Jira (PUP-9714) Add support for nested hiera interpolation
Title: Message Title Josh Cooper updated an issue Puppet / PUP-9714 Add support for nested hiera interpolation Change By: Josh Cooper Sub-team: Language Add Comment This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93) -- 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. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-bugs/JIRA.309648.1558477577000.22504.1559064301461%40Atlassian.JIRA. For more options, visit https://groups.google.com/d/optout.
Jira (PUP-9714) Add support for nested hiera interpolation
Title: Message Title Nick Bertrand created an issue Puppet / PUP-9714 Add support for nested hiera interpolation Issue Type: New Feature Assignee: Unassigned Created: 2019/05/21 3:26 PM Priority: Normal Reporter: Nick Bertrand This commit adds support for two levels of nested hiera interpolations. For example, given a fact called hostgroup with value group1, the following hiera data would have local_users::add::users.root.password set to $6$ --- group1_root_password: $6$ local_users::add::users: root: password: '%{lookup("%{facts.hostgroup}_root_password")}' If this is useful for merging, I would be glad to update any necessary documentation.