Thanks to everyone who kicked the tires on the experimental data in modules feature included in Puppet 3.3.0. We got a lot of feedback, some cool proof-of-concept modules, and a definitive conclusion to the experiment.
The idea of including a module-specific hiera backend is centered around one primary use case: replacing the 'params class pattern', a common idiom in Puppet modules that's described in the [Using Parameterized Classes][param-classes] guide. The problem that most testers ran into though is that for non-trivial modules they ended up having to re-implement the Puppet DSL logic encoded in their params.pp in convoluted, non-obvious ways. The solutions to this led to more contortions until we'd ended up with the ability to execute parser functions in the right-hand-side of a yaml value. So something which started out trying to help separate data from code ended up putting code back into data!
Additionally, even after multiple attempts to simplify the surface area and user experience with the bindings system (described in ARM-9) that underlay the data-in-modules implementation, users still found its complexity daunting. There are some important bits of scaffolding (like an actual type system for Puppet!) that will prove valuable as more of the future parser and evaluator work that Henrik is building makes its way into the product, but in the final analysis the data in modules feature was the wrong vehicle to introduce them.
Refocusing on the problems users were trying to solve (and here I have to give shout-outs to Ashley Penney for his [puppetlabs-ntp][] branch and the dynamic duo of Spencer Krug/William van Hevelingen for their [startrek][] module) and the problems with the 'params' pattern lent some clarity. We've gotten into a situation of disparity with regard to hiera and data bindings, because data bindings enable module _users_ to use their site-wide hiera data but don't provide moduel _authors_ the same affordance. But rather than introduce additional complexity, we can close the gap for existing code patterns.
So the proposed solution at this point is:
- enable an implicit data-binding lookup against the hiera-puppet backend for a value of 'classname::variable' in the file 'modules/classname/manifests/params.pp', which simplifies class definition and provides consistency with other hiera backends. As a module author, you'd still leave your logic for variables in params.pp, but they'd be implicitly looked up via data bindings as the class is declared, after consulting site-wide hiera.
--
You received this message because you are subscribed to the Google Groups "Puppet Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-dev+...@googlegroups.com.
To post to this group, send email to puppe...@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-dev.
For more options, visit https://groups.google.com/groups/opt_out.
Thanks to everyone who kicked the tires on the experimental data in modules feature included in Puppet 3.3.0. We got a lot of feedback, some cool proof-of-concept modules, and a definitive conclusion to the experiment.
The idea of including a module-specific hiera backend is centered around one primary use case: replacing the 'params class pattern', a common idiom in Puppet modules that's described in the [Using Parameterized Classes][param-classes] guide. The problem that most testers ran into though is that for non-trivial modules they ended up having to re-implement the Puppet DSL logic encoded in their params.pp in convoluted, non-obvious ways. The solutions to this led to more contortions until we'd ended up with the ability to execute parser functions in the right-hand-side of a yaml value. So something which started out trying to help separate data from code ended up putting code back into data!
Additionally, even after multiple attempts to simplify the surface area and user experience with the bindings system (described in ARM-9) that underlay the data-in-modules implementation, users still found its complexity daunting. There are some important bits of scaffolding (like an actual type system for Puppet!) that will prove valuable as more of the future parser and evaluator work that Henrik is building makes its way into the product, but in the final analysis the data in modules feature was the wrong vehicle to introduce them.
Refocusing on the problems users were trying to solve (and here I have to give shout-outs to Ashley Penney for his [puppetlabs-ntp][] branch and the dynamic duo of Spencer Krug/William van Hevelingen for their [startrek][] module) and the problems with the 'params' pattern lent some clarity. We've gotten into a situation of disparity with regard to hiera and data bindings, because data bindings enable module _users_ to use their site-wide hiera data but don't provide moduel _authors_ the same affordance. But rather than introduce additional complexity, we can close the gap for existing code patterns.
So the proposed solution at this point is:
- enable an implicit data-binding lookup against the hiera-puppet backend for a value of 'classname::variable' in the file 'modules/classname/manifests/params.pp', which simplifies class definition and provides consistency with other hiera backends. As a module author, you'd still leave your logic for variables in params.pp, but they'd be implicitly looked up via data bindings as the class is declared, after consulting site-wide hiera.
I see hiera data in modules just being a very useful extension of the current hiera implementation.
Why
1) separate out the variables my dev teams use into the modules so that it is easier to package their changes. Promoting their module includes all of their heir data.
2) In an enterprise environment this allows other modules to access that data when the modules are not totally independent. Eg.. I have a apache_module_v1 and a apache_business_unit_v2 that uses the apache module.
3) access controls by adding hiera into modules as opposed to a main hiera directory structure. The developers just need access to their modules.
4) We version our modules so that they call all be active at the same time and the old modules only have maintenance updates. Hiera in modules means the central hiera is not touched by the developers.
eg. apache_module_v1
apache_module_v2
apache_module_v3
What would be nice but not necessary:
1) defined variable automatically have classname added to avoid global conflicts.
eg.
Module: apache
variable: port
becomes global hiera: apache::port
On Fri, Oct 11, 2013 at 11:09 AM, Eric Sorenson <eric.s...@puppetlabs.com> wrote:
Thanks to everyone who kicked the tires on the experimental data in modules feature included in Puppet 3.3.0. We got a lot of feedback, some cool proof-of-concept modules, and a definitive conclusion to the experiment.
The idea of including a module-specific hiera backend is centered around one primary use case: replacing the 'params class pattern', a common idiom in Puppet modules that's described in the [Using Parameterized Classes][param-classes] guide. The problem that most testers ran into though is that for non-trivial modules they ended up having to re-implement the Puppet DSL logic encoded in their params.pp in convoluted, non-obvious ways. The solutions to this led to more contortions until we'd ended up with the ability to execute parser functions in the right-hand-side of a yaml value. So something which started out trying to help separate data from code ended up putting code back into data!
Additionally, even after multiple attempts to simplify the surface area and user experience with the bindings system (described in ARM-9) that underlay the data-in-modules implementation, users still found its complexity daunting. There are some important bits of scaffolding (like an actual type system for Puppet!) that will prove valuable as more of the future parser and evaluator work that Henrik is building makes its way into the product, but in the final analysis the data in modules feature was the wrong vehicle to introduce them.
Refocusing on the problems users were trying to solve (and here I have to give shout-outs to Ashley Penney for his [puppetlabs-ntp][] branch and the dynamic duo of Spencer Krug/William van Hevelingen for their [startrek][] module) and the problems with the 'params' pattern lent some clarity. We've gotten into a situation of disparity with regard to hiera and data bindings, because data bindings enable module _users_ to use their site-wide hiera data but don't provide moduel _authors_ the same affordance. But rather than introduce additional complexity, we can close the gap for existing code patterns.
So the proposed solution at this point is:
- enable an implicit data-binding lookup against the hiera-puppet backend for a value of 'classname::variable' in the file 'modules/classname/manifests/params.pp', which simplifies class definition and provides consistency with other hiera backends. As a module author, you'd still leave your logic for variables in params.pp, but they'd be implicitly looked up via data bindings as the class is declared, after consulting site-wide hiera.
+1Really happy to see this solved in a way that will not lead to complex migrations to Puppet 4.Although, to play devil's advocate, two concerns:the special nature of params as a namespace suffix:- how do users know not to use this namespace for anything else?- What if user declares resources in params? Does this fail? Do they always get realized when anything else from that namespace is applied?the magic mapping from <x>::parameter <x>::params::parameter may be something hard to grok for new users who are not already familiar with the params pattern. This is probably solvable with documentation and --debug logging, but still worth noting.
---version: 3hierarchy:- category: 'osfamily'- category: 'operatingsystem'- category: '^{install}'- category: 'environment'- category: 'common'paths:- 'is_virtual/${is_virtual}'- 'common'
Thanks to everyone who kicked the tires on the experimental data in modules feature included in Puppet 3.3.0. We got a lot of feedback, some cool proof-of-concept modules, and a definitive conclusion to the experiment.
The idea of including a module-specific hiera backend is centered around one primary use case: replacing the 'params class pattern', a common idiom in Puppet modules that's described in the [Using Parameterized Classes][param-classes] guide.
So the proposed solution at this point is:
- enable an implicit data-binding lookup against the hiera-puppet backend for a value of 'classname::variable' in the file 'modules/classname/manifests/params.pp', which simplifies class definition and provides consistency with other hiera backends. As a module author, you'd still leave your logic for variables in params.pp, but they'd be implicitly looked up via data bindings as the class is declared, after consulting site-wide hiera.
I'm not saying that categorically getting rid of ::params classes is a viable target. In fact, I don't really understand why it was ever an objective in the first place. On the other hand, I don't see why it makes sense for Puppet to give special significance to that pattern, either. A more general data-in-modules feature such as I describe would give users the option to avoid ::params classes in some cases, and I'm inclined to think that it would be easier to implement, to understand, and to use.
John
What would be nice but not necessary:
1) defined variable automatically have classname added to avoid global conflicts.
eg.
Module: apache
variable: port
becomes global hiera: apache::port
---version: 3hierarchy:- category: 'osfamily'- category: 'operatingsystem'
- category: '^{install}' # Is this possible? Is this the correct syntax?
- category: 'environment'- category: 'common'paths:- 'is_virtual/${is_virtual}'- 'common'
one file that tends to include data for many different roles/sources/uses.
You have to consider the main reasons for separating data from code in order
to understand the motivation.
When you have a params.pp you end up with stuff like this:
https://github.com/puppetlabs/puppetlabs-ntp/blob/master/manifests/params.pp#L28-140
From a Puppet system perspective its important that this feature behave consistently
and predictably with the current more or less universally accepted standard of data
seperation - hiera. And hiera is all about data, the hiera puppet backend has been
broken for ages and not been missed because it does not provide a solution that solves
the above points. And so the data separation around params.pp will not solve the real
problems either.
John Bollinger wrote:
> We agree on most of what you said, but it doesn't seem very responsive to
> the comments to which they ostensibly reply. I am in no way arguing
> against the idea of the data in modules subsystem. It is a fantastic idea,
> and long past due. I *am* concerned, however, about the new approach Eric
> proposed. I suggested a more general approach than (my understanding of)
> the one he described, one not tied specifically to ::params classes.
> Inasmuch as you disfavor ::params classes, I would think that you would
> find much to like about my counterproposal. Indeed, I think my proposal is
> very much like the original prototype you floated.
Do I understand correctly that you set out to get rid of the ::params class pattern, but now you favor an approach that depends on that pattern?
Why is that better than being more general: enable an implicit lowest-priority hierarchy level for values of form 'modulename::variable', drawing on data from per-module data files such as modules/modulename/data.yaml?
RI replied:
Your comments are good and addressed in later replies, especially related to
data mangling. This is a common problem in all languages, data almost never
arrives in the final form and all programming languages have patterns for
retrieving data, validating and mangling it. We just need to introduce
similar patterns.
I, obviously, share your concern with the current round of proposals. Data
in module querying only params.pp is literally the worst possible suggestion
one can make in this regard. It would be a massive step backward. Might as
well just go ahead and unmerge hiera if the goal is to not learn anything from
its design and incredibly wide adoption.
> I do think it is a mistake to focus on eliminating all need for ::params
> classes as a goal of the initiative, however. Likely *most* need for them
> can be redirected to a relatively simple data-in-modules subsystem, and
> that would be well, but the initiative does not fail if some need for the
> ::params class pattern remains.
yeah, as per the other replies - eliminate *storing data* in params.pp but
validate/mangle in something like params.pp. That is in the event that
no-one delivers a layer of data validation around data bindings and hiera.
Another round of thanks for the replies to this thread. I apologize that almost as soon as I posted it, I got pulled off onto another project and wasn't able to follow up until now. Replies inline below, and there are probably a couple more coming to different branches (damn I miss Usenet threading!)John Bollinger wrote:
> We agree on most of what you said, but it doesn't seem very responsive to
> the comments to which they ostensibly reply. I am in no way arguing
> against the idea of the data in modules subsystem. It is a fantastic idea,
> and long past due. I *am* concerned, however, about the new approach Eric
> proposed. I suggested a more general approach than (my understanding of)
> the one he described, one not tied specifically to ::params classes.
> Inasmuch as you disfavor ::params classes, I would think that you would
> find much to like about my counterproposal. Indeed, I think my proposal is
> very much like the original prototype you floated.John I didn't see a more detailed description of what you're proposing; is this section (quoted from upthread) what you're referring to?
Do I understand correctly that you set out to get rid of the ::params class pattern, but now you favor an approach that depends on that pattern?Heh, well when you put it that way...
Why is that better than being more general: enable an implicit lowest-priority hierarchy level for values of form 'modulename::variable', drawing on data from per-module data files such as modules/modulename/data.yaml?If I understand this correctly this is slightly different (and probably inadequate from RI's standpoint), because it just adds another 'category' (in the ARM-9 sense) to the end of each lookup, and what RI and others propose is to have another _complete hiera invocation_ inside the module owning a class parameter's namespace the end of each unsuccessful site-hiera lookup. Separate hiera.yaml config file with its own hierarchy defined, and a tree of data files. (params.pp does this by letting old-school puppet DSL logic determine your "hierarchy")
I also talked to a user today who wants data from modules (by doing hash key merge on a parameter's class::subclass::varname) from *any* module in the modulepath to contribute, say, sudoers rules to the sudo module from other site-written modules that require particular sudoers stanzas. So I'm trying to consider how to pull all of this together without making a O(n^n) complexity explosion.
Thanks to everyone who kicked the tires on the experimental data in modules feature included in Puppet 3.3.0. We got a lot of feedback, some cool proof-of-concept modules, and a definitive conclusion to the experiment.
The idea of including a module-specific hiera backend is centered around one primary use case: replacing the 'params class pattern', a common idiom in Puppet modules that's described in the [Using Parameterized Classes][param-classes] guide. The problem that most testers ran into though is that for non-trivial modules they ended up having to re-implement the Puppet DSL logic encoded in their params.pp in convoluted, non-obvious ways. The solutions to this led to more contortions until we'd ended up with the ability to execute parser functions in the right-hand-side of a yaml value. So something which started out trying to help separate data from code ended up putting code back into data!
Additionally, even after multiple attempts to simplify the surface area and user experience with the bindings system (described in ARM-9) that underlay the data-in-modules implementation, users still found its complexity daunting. There are some important bits of scaffolding (like an actual type system for Puppet!) that will prove valuable as more of the future parser and evaluator work that Henrik is building makes its way into the product, but in the final analysis the data in modules feature was the wrong vehicle to introduce them.
Refocusing on the problems users were trying to solve (and here I have to give shout-outs to Ashley Penney for his [puppetlabs-ntp][] branch and the dynamic duo of Spencer Krug/William van Hevelingen for their [startrek][] module) and the problems with the 'params' pattern lent some clarity. We've gotten into a situation of disparity with regard to hiera and data bindings, because data bindings enable module _users_ to use their site-wide hiera data but don't provide moduel _authors_ the same affordance. But rather than introduce additional complexity, we can close the gap for existing code patterns.
So the proposed solution at this point is:
- enable an implicit data-binding lookup against the hiera-puppet backend for a value of 'classname::variable' in the file 'modules/classname/manifests/params.pp', which simplifies class definition and provides consistency with other hiera backends. As a module author, you'd still leave your logic for variables in params.pp, but they'd be implicitly looked up via data bindings as the class is declared, after consulting site-wide hiera.
--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/f312d16c-0695-48a9-a630-2016fff1ba91%40googlegroups.com.