Jira (PUP-7515) data-in-modules: lookup() and automatic class parameter lookup result in different values
Title: Message Title Kenn Hussey updated an issue Puppet / PUP-7515 data-in-modules: lookup() and automatic class parameter lookup result in different values Change By: Kenn Hussey Flagged: Impediment Add Comment This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe) -- 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-7515) data-in-modules: lookup() and automatic class parameter lookup result in different values
Title: Message Title Geoff Nichols assigned an issue to Unassigned Puppet / PUP-7515 data-in-modules: lookup() and automatic class parameter lookup result in different values Change By: Geoff Nichols Assignee: Jorie Tappa Add Comment This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe) -- 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-7515) data-in-modules: lookup() and automatic class parameter lookup result in different values
Title: Message Title Geoff Nichols commented on PUP-7515 Re: data-in-modules: lookup() and automatic class parameter lookup result in different values PR #5944 merged to puppet#stable at https://github.com/puppetlabs/puppet/commit/a8e941870038e60d8c34ef071fa4df2f04237af4. Add Comment This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe) -- 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-7515) data-in-modules: lookup() and automatic class parameter lookup result in different values
Title: Message Title Kenn Hussey updated an issue Puppet / PUP-7515 data-in-modules: lookup() and automatic class parameter lookup result in different values Change By: Kenn Hussey Flagged: Impediment Add Comment This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe) -- 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-7515) data-in-modules: lookup() and automatic class parameter lookup result in different values
Title: Message Title John Duarte updated an issue Puppet / PUP-7515 data-in-modules: lookup() and automatic class parameter lookup result in different values Change By: John Duarte QA Risk Assessment: Needs Assessment No Action Add Comment This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe) -- 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-7515) data-in-modules: lookup() and automatic class parameter lookup result in different values
Title: Message Title Geoff Nichols assigned an issue to Jorie Tappa Puppet / PUP-7515 data-in-modules: lookup() and automatic class parameter lookup result in different values Change By: Geoff Nichols Assignee: Jorie Tappa Add Comment This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe) -- 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-7515) data-in-modules: lookup() and automatic class parameter lookup result in different values
Title: Message Title Henrik Lindberg updated an issue Puppet / PUP-7515 data-in-modules: lookup() and automatic class parameter lookup result in different values Change By: Henrik Lindberg Fix Version/s: PUP 4.10.2 Add Comment This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe) -- 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-7515) data-in-modules: lookup() and automatic class parameter lookup result in different values
Title: Message Title Henrik Lindberg assigned an issue to Unassigned Puppet / PUP-7515 data-in-modules: lookup() and automatic class parameter lookup result in different values Change By: Henrik Lindberg Assignee: Henrik Lindberg Add Comment This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe) -- 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-7515) data-in-modules: lookup() and automatic class parameter lookup result in different values
Title: Message Title Henrik Lindberg assigned an issue to Henrik Lindberg Puppet / PUP-7515 data-in-modules: lookup() and automatic class parameter lookup result in different values Change By: Henrik Lindberg Assignee: Henrik Lindberg Add Comment This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe) -- 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-7515) data-in-modules: lookup() and automatic class parameter lookup result in different values
Title: Message Title Henrik Lindberg updated an issue Puppet / PUP-7515 data-in-modules: lookup() and automatic class parameter lookup result in different values Change By: Henrik Lindberg Story Points: 1 Release Notes Summary: This is a documentation update only. Sprint: Language Triage Agent 2017-06-14 Release Notes: Not Needed Add Comment This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe) -- 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,
Jira (PUP-7515) data-in-modules: lookup() and automatic class parameter lookup result in different values
Title: Message Title Henrik Lindberg updated an issue Puppet / PUP-7515 data-in-modules: lookup() and automatic class parameter lookup result in different values Change By: Henrik Lindberg Sprint: Agent Language Triage Add Comment This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe) -- 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-7515) data-in-modules: lookup() and automatic class parameter lookup result in different values
Title: Message Title Thomas Hallgren commented on PUP-7515 Re: data-in-modules: lookup() and automatic class parameter lookup result in different values As with classic Hiera, the hiera, hiera_hash, hiera_array, and hiera_include will act on the global data. The hiera_hash (and only hiera_hash) can be configured using the merge_behavior in a version 3 hiera.yaml. None of these deprecated functions will use the lookup_options. Add Comment This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe) -- 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-7515) data-in-modules: lookup() and automatic class parameter lookup result in different values
Title: Message Title Robert Heinzmann commented on PUP-7515 Re: data-in-modules: lookup() and automatic class parameter lookup result in different values One more thing. It seems that hiera_hash is ignoring the lookup_options and does always use the hash lookup strategy. Is this correct ? I followed the guide at https://docs.puppet.com/puppet/4.10/hiera_migrate_v3_yaml.html#remove-dead-settings and migrated to lookup_options. In hiera3 behaviour could be changed by using :merge_behaviour: deeper in hiera.yaml at the global layer. Then hiera_hash did a merge lookup. I now set lookup_options to "merge: deep" at the environment layer, however this seems to be ignored for hiera_hash(). If so, how can I migrate from a hiera3 config with only the global layer that has :merge_behaviour: deeper enabled to Puppet with directory environments without modifying module code that uses hiera_hash and hiera. How can I enable deep merge for hiera_hash in this setup ? Can I do that, or do I need to migrate the puppet code to lookup or APL (which might be difficult for community code) ? Environment hiera.yaml: SERVER mymodule # cat /etc/puppetlabs/code/environments/production/hiera.yaml --- version: 5 defaults: datadir: data data_hash: yaml_data
Jira (PUP-7515) data-in-modules: lookup() and automatic class parameter lookup result in different values
Title: Message Title Henrik Lindberg commented on PUP-7515 Re: data-in-modules: lookup() and automatic class parameter lookup result in different values This relates to SDK and best practices/style guide in general, and those in relationship with hiera/lookup in particular. Ping Lindsey Smith - I believe there are stories in place in Jira for user guides etc. Want to take or reference this ticket as input to what users face and need help with figuring out? Add Comment This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe) -- 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-7515) data-in-modules: lookup() and automatic class parameter lookup result in different values
Title: Message Title Ethan Brown commented on PUP-7515 Re: data-in-modules: lookup() and automatic class parameter lookup result in different values Henrik Lindberg should we resolve this with documentation? Add Comment This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe) -- 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-7515) data-in-modules: lookup() and automatic class parameter lookup result in different values
Title: Message Title Ethan Brown updated an issue Puppet / PUP-7515 data-in-modules: lookup() and automatic class parameter lookup result in different values Change By: Ethan Brown Team: Puppet Developer Experience Agent Add Comment This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe) -- 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-7515) data-in-modules: lookup() and automatic class parameter lookup result in different values
Title: Message Title Ethan Brown updated an issue Puppet / PUP-7515 data-in-modules: lookup() and automatic class parameter lookup result in different values Change By: Ethan Brown Sprint: PDE Agent Triage Add Comment This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe) -- 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-7515) data-in-modules: lookup() and automatic class parameter lookup result in different values
Title: Message Title Henrik Lindberg commented on PUP-7515 Re: data-in-modules: lookup() and automatic class parameter lookup result in different values Robert Heinzmann Hm, that requires quite a lot of words to explain. Unfortunately there is no succinct specification of all variable resolution, and there are bugs that have been fixed along the way. It is also quite complex, and in parts probably not even desired as puppet once had "dynamic scoping" with very strange rules (and some of those remain for the sake of backwards compatibility). First, there is a big difference if a name is qualified or not (qualified == the name has '::' somewhere inside it). A qualified name is always absolute (absolute == starts from top scope). A qualified variable always resolves directly (no search) except when the name refers to a class variable (class parameter or introduced in a class scope as a local variable) and where the class inherits from another. Example - $b::x where 'b' inherits 'a', will search for 'b::x', and then 'a::x'. (To make this quite confusing; there is a bug (PUP-5635, fixed in Puppet 5.0.0) that makes the search continue with a non qualified search for 'x'). You can view a qualified variable resolution as an external "being outside looking in" kind of resolution. A non qualified variable (there are no '::' in the name) is searched for as a relative name; first in the scope where the resolution originates (the reference to the variable), then the parent scopes of the local scope until hitting a class or resource scope, then the inherited class' scope (if any) else the enclosing scope (the scope where the class was included). Unless an inherited class is already included, it will be included in the same scope as the inheriting class. Note that the relative resolution searches inherited, and then the inherited's class enclosing scope (it skips the class' enclosing scope all together in the search!). You can think of a relative name resolution as an "ascending search through the 'parent/enclosing' chain" on the formula (Here -> (Inherited || Enclosing) -> Enclosing) until topscope is reached. Resolutions that take place in Parameter Scope are somewhat special - as the parameters are evaluated as part of creating a class / resource and the thing being created does not quite yet exist. This part is specified https://github.com/puppetlabs/puppet-specifications/blob/master/language/parameter_scope.md The the complicated resolution of variable references in Puppet creates many to scratch their heads as it is difficult to reason about what will happen. Therefore the recommendations (to avoid the problems) are: Do not use class inheritance Use APL to set values for missing parameters Refer to all facts using $facts Use ENC instead of node expressions if using node expressions, do not rely on node scope level variables
Jira (PUP-7515) data-in-modules: lookup() and automatic class parameter lookup result in different values
Title: Message Title Robert Heinzmann commented on PUP-7515 Re: data-in-modules: lookup() and automatic class parameter lookup result in different values So much text ... so what is the question to the Puppet Team ? Q1) Is all the described here expected behaviour of puppet (part of spec) and can module developers and puppetmaster operators rely on this behaviour to be stable as of Puppet 4.10.0++ (and write test against it) ? Add Comment This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe) -- 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-7515) data-in-modules: lookup() and automatic class parameter lookup result in different values
Title: Message Title Robert Heinzmann commented on PUP-7515 Re: data-in-modules: lookup() and automatic class parameter lookup result in different values Regarding 1) - for others who might read this Q: Now how to fix the hiera_* calls? A: With global: hiera3/hiera5 and environment: hiera5 all three parameters are the same, also for hiera_* calls: Global Layers: Global Layer Hiera3: SERVER mymodule # cat global_hiera_3.yaml --- :backends: - yaml :hierarchy: - "common" :yaml: :datadir: /data/hiera
Jira (PUP-7515) data-in-modules: lookup() and automatic class parameter lookup result in different values
Title: Message Title Robert Heinzmann commented on PUP-7515 Re: data-in-modules: lookup() and automatic class parameter lookup result in different values For others who might read this thread: I tested with lookup_options and it makes the behaviour of lookup and APL (Automatic Parameter Lookup) consistent: SERVER mymodule # bash enc.sh --- parameters: role: - role1 Without lookup_options: SERVER mymodule # FACTER_role_txt=role2 puppet apply --node_terminus=exec --external_nodes=$(pwd)/enc.sh --modulepath ../ -e 'include mymodule' --strict off --hiera_config=../devnull Warning: The node parameter 'role' for node 'SERVER' was already set to '["role1"]'. It could not be set to '["role2"]' Notice: Scope(Class[Mymodule]): === Config ==
Jira (PUP-7515) data-in-modules: lookup() and automatic class parameter lookup result in different values
Title: Message Title Thomas Hallgren commented on PUP-7515 Re: data-in-modules: lookup() and automatic class parameter lookup result in different values Yes, you can specify merge behavior for specific keys (or keys that matches a specific pattern) using lookup_options in the hiera data files. Add Comment This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe) -- 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-7515) data-in-modules: lookup() and automatic class parameter lookup result in different values
Title: Message Title Robert Heinzmann commented on PUP-7515 Re: data-in-modules: lookup() and automatic class parameter lookup result in different values Can the behaviour 2. be changed with lookup_options in the yaml files ? Add Comment This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe) -- 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-7515) data-in-modules: lookup() and automatic class parameter lookup result in different values
Title: Message Title Thomas Hallgren commented on PUP-7515 Re: data-in-modules: lookup() and automatic class parameter lookup result in different values There are a couple of things to consider: hiera_xxx are not expected to work unless you specifically enable Hiera 5 in the environment layer. Unless that's done, the described behavior is expected. These functions are deprecated and the default is to limit all such lookups to global layer. The deep merge strategy is used for the explicit lookup call. In contrast, the Automatic Parameter Lookup (henceforth referred to as APL) will use the default strategy which is to return the entry that is first found. This explains the "strange" class parameter when using ENC or FACT. Both returns '{"plugin_role1"=>{"ensure"=>"present"}}' which is the first entry found. This is the expected behavior. The lookup command and the APL for the $plugins parameter does not use the same scope when evaluating. When the lookup function evaluates, all parameters have a value. The APL for $plugins uses a special parameter scope where parameters that are positioned before the parameter to evaluate are visible. That means that $role should have a value but from the looks of it, Hiera doesn't see that value. This is not the expected behavior and needs to be investigated further. Add Comment This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe) -- 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
Jira (PUP-7515) data-in-modules: lookup() and automatic class parameter lookup result in different values
Title: Message Title Henrik Lindberg updated an issue Puppet / PUP-7515 data-in-modules: lookup() and automatic class parameter lookup result in different values Thanks for the excellent report Robert Heinzmann ! Ping Thomas Hallgren Change By: Henrik Lindberg Team: Puppet Developer Experience Sprint: PDE Triage Add Comment This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe) -- 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-7515) data-in-modules: lookup() and automatic class parameter lookup result in different values
Title: Message Title Robert Heinzmann updated an issue Puppet / PUP-7515 data-in-modules: lookup() and automatic class parameter lookup result in different values Change By: Robert Heinzmann Acceptance Criteria: - Hiera lookup for lookup() and automatic class parameter lookup should be same- Hiera lookup should support class variable passing via ENC / Hiera and direct class param - Module authors should have a clear understanding of how develop future-proof modules using lookup and class parameters Add Comment This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe) -- 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-7515) data-in-modules: lookup() and automatic class parameter lookup result in different values
Title: Message Title Robert Heinzmann updated an issue Puppet / PUP-7515 data-in-modules: lookup() and automatic class parameter lookup result in different values Change By: Robert Heinzmann Acceptance Criteria: - Hiera lookup for lookup () and automatic class parameter lookup should be same- Hiera lookup should support class variable passing via ENC / Hiera and direct class param Add Comment This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe) -- 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.