Thanks,
Justin
--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To post to this group, send email to puppet...@googlegroups.com.
To unsubscribe from this group, send email to puppet-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Hope to have given reasonable answers ;-)al
--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/VaO0zq3x_OsJ.
To post to this group, send email to puppet...@googlegroups.com.
To unsubscribe from this group, send email to puppet-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
What would it take for you to just have one source of truth for data Alessandro?e.g. what would we have to change about Puppet for us to simply use Hiera ?We're looking to integrate Hiera into Puppet for Telly, and in general moving data outside of manifests has a lot of benefits, but I'm interested to know whether you're of a similar mind with regard to the data you're considering.
I guess it would look much like facter: it just provides values, but
hides where it got the values for those variables from. As Nigel
pointed out, data needs to be moved to outside manifests, and hiera
seems like a good tool for it.
Walter
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/puppet-users/-/l1YoNqgCGqsJ.
>
> To post to this group, send email to puppet...@googlegroups.com.
> To unsubscribe from this group, send email to
> puppet-users...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/puppet-users?hl=en.
--
Walter Heck
--
follow @walterheck on twitter to see what I'm up to!
--
Check out my new startup: Server Monitoring as a Service @ http://tribily.com
Follow @tribily on Twitter and/or 'Like' our Facebook page at
http://www.facebook.com/tribily
----- Original Message -----
> I would be very happy to see a seamless/lazy/magic approach to using
> variables. Something similar to what Al quoted seems nice: I'd like
> to
> be able to have the option to feed values to variables in different
> places (of which one will take precedence over the other, and you
> preferrably add a value only in one place) and then use that variable
> in the module itself. That would make reuse of modules by others so
> much nicer as they wouldn't be tied to using whatever your
> environment
> looks like that you developed the modules for.
>
> I guess it would look much like facter: it just provides values, but
> hides where it got the values for those variables from. As Nigel
> pointed out, data needs to be moved to outside manifests, and hiera
> seems like a good tool for it.
sounds like you want to use hiera
http://www.devco.net/archives/2011/06/06/puppet_backend_for_hiera.php
So, to reply to your question, Nigel, something like a hiera backend or a Puppet function that does what is written before in any Puppet setup would be what I need.The ideal, maybe, would be a simple function that does the above and then if Hiera is in place, uses Hiera without requiring it: I really would like to reach a scenario where a person picks a single module and eventually the dependent modules (stdlib and so on), and can use it on his Puppetmaster without the need to introduce Hiera on it, if it's not already there.This, at least, until most of the people will have a PuppetMaster with integrated Hiera ... till that moment I would like to have modules usable in the widest range of Puppet setups possible.
Ah, I didn't see before that it actually gets it's data from mutliple
backends. That's pretty sweet!
On Sun, Jan 15, 2012 at 12:42 AM, Alessandro Franceschi <a...@lab42.it> wrote:So, to reply to your question, Nigel, something like a hiera backend or a Puppet function that does what is written before in any Puppet setup would be what I need.The ideal, maybe, would be a simple function that does the above and then if Hiera is in place, uses Hiera without requiring it: I really would like to reach a scenario where a person picks a single module and eventually the dependent modules (stdlib and so on), and can use it on his Puppetmaster without the need to introduce Hiera on it, if it's not already there.This, at least, until most of the people will have a PuppetMaster with integrated Hiera ... till that moment I would like to have modules usable in the widest range of Puppet setups possible.So here's the rough idea we have in place.
Parameterized class lookups are automatically consulted in a Hiera backend.The lookup order would be as follows:1. directly supplied value in the declaration of the class:class { "foo": param => "value" }2. Hiera backend3. Default value supplied in the definition of the class:class foo ($param = "value") { ... }This would happen automatically, without requiring the use of a hiera() like function in the class definition.
It's clear that we need to have a way for module authors to specify values in the definition of the class.Is this satisfied well by having the values in the manifests themselves as in (3) above?
Or should we be encouraging authors to put a Hiera-style backend inside their modules and have that be consulted for default values?
I'm not particularly fond of the work we're making people do around polluting the global namespace with class-specific data.That's something I think we should probably remove entirely, but open to suggestions.
On Sunday, January 15, 2012 9:30:02 PM UTC+1, Nigel Kersten wrote:So here's the rough idea we have in place.Let me contextualize: What you suggest here is what may be introduced in 2.8 , when Hiera will be integrated into Puppet?
Parameterized class lookups are automatically consulted in a Hiera backend.The lookup order would be as follows:1. directly supplied value in the declaration of the class:class { "foo": param => "value" }2. Hiera backend3. Default value supplied in the definition of the class:class foo ($param = "value") { ... }This would happen automatically, without requiring the use of a hiera() like function in the class definition.+1I like the fact that this is transparent... if you have an Hiera backend then it's used, if not (or if you use an older Puppet version), normal behavior is followed.
It's clear that we need to have a way for module authors to specify values in the definition of the class.Is this satisfied well by having the values in the manifests themselves as in (3) above?Well a simple class foo ($param = "value") { ... } might not be enough, some logic (for example a different value for different operating systems) to give defaults values might be needed (back to params.pp ...)Or should we be encouraging authors to put a Hiera-style backend inside their modules and have that be consulted for default values?For me is saner to leave to puppet dsl the management of the values to attribute to these internal variables.It's how we always have done it and, for me, it works.
I'm not particularly fond of the work we're making people do around polluting the global namespace with class-specific data.That's something I think we should probably remove entirely, but open to suggestions.-1 if I understood wellIf you mean that you would remove the possibility to define top scope variables with custom names (ie things like ::monitor = true but also ::monitor_openssh = true) please let me know when and how this could happen.
As a user I'm not so fond of radical changes in the Puppet code that make unusable manifests made for earlier Puppet versions (hint: dynamic variables scoping no more possible in 2.8: I understand that they were a source of various problems, but that was just for users misuse due eventually to not clear enough directives/documentation/best practices).I understand that this is done for a "better future" and that retrocompatibility should not be a dogma, but... well... when I write some Puppet code I hope it's going to work for some years...
Thanks for the great replies Nigel. As a person currently rolling out
Puppet into production I'm stricken with doubt about how to best
represent variables in a module. It would seem to me that I need to:
1. set default values in params.pp (based on facts, yadda yadda)
2. allow those values to be overridden by global namespace variables
(for enc support)
3. further allow parametrized class declarations to take precedence
over 1 and 2
Can you point me to a module that does this? Alternatively, can you
make a recommendation for module best practices going forward.