On Sat, Jan 14, 2012 at 2:09 PM, Alessandro Franceschi <a...@lab42.it> wrote:
> Gary has already given a good reply, let me just add some of the > motivations that have driven this approach in my new modules (example42): > - I want all the variables used in a Puppet class to be visible to the > system (in my case Puppi, so that I can do interesting things with them): > Puppet know so much about how a system is configured that I find it somehow > reductive to use all this knowledge "just" to configure things :-) > - Parametrized class are cool, but they can be a PITA to repeat every time > you use them some common parameters (in my case if and how to monitor the > class' resources, if to firewall it or activate puppi for it and so on) > - In params.pp you can set default values and manage the differences among > different operating system (which is something that the user should not > care about) . I present these module internal variables (such as > packagename, processname, servicename and so on) as class parameters > because I need them for my puppi things (look at what is done when puppi is > set to true in https://github.com/example42/**puppet-openssh/blob/master/* > *manifests/init.pp<https://github.com/example42/puppet-openssh/blob/master/manifests/init.pp> > ) > - Parametrized classes are cool but you can't (still) use them in the > common ENCs around (PuppetDashboard, the Foreman). In Puppet AFAIK, > extenarl nodes can have just some variables set and classes included. > That's why I wanted to preserve the "old" style set variables+include class > approach. > Actually in my new modules you can mix global variables and class > parameters seamlessly. > > All this approach requires some verbose extra code in params.pp but for me > is worth the effort. > Also Dan Bode has suggested to create a custom function that makes the > same lookups for each parameter (params class, custom classes, top scope > variables and hiera lookups) that would save a lot of extra code in > params.pp . So there might be some further development in this area. > 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. > 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-users@googlegroups.com. > To unsubscribe from this group, send email to > puppet-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/puppet-users?hl=en. > -- Nigel Kersten Product Manager, Puppet Labs -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.