On 2013-02-07 9:54, Simon Marechal wrote:
On Monday, July 1, 2013 4:00:44 PM UTC+2, henrik lindberg wrote:
I would say that these are of value when dealing with messy data. If
you
are in charge of all aspects of the system (including the structure if
all data) then these are naturally of less value simply because
there is
no need to do more advanced data transformations.
Another perhaps controversial idea : I thought that custom functions
were excellent tools for this. They let you decouple complex logic from
resource declaration. Their usage is well documented, they are really
easy to write, mostly even readable, and can be reused.
Not at all controversial, that is exactly what functions are for.
The issues here are:
- far from all are comfortable programming in Ruby, and creating a
custom Puppet function in Ruby is perceived as far more complicated than
writing a transforming iteration in the puppet language
- the parts written in ruby are much more difficult to deal with: are
they correct? what may I touch/modify, etc... what is the API?
- the function namespace is flat and I you to name functions with long
names to be certain they do not clash across modules. I can't hide my
functions - it becomes a flea-market. Instead, I have seen that people
tend to use inline templates with Ruby snippets since they do not have
to be named. Have also seen complicated functions that look like
swiss-army-knifes having lots of flags and options to also do data
transformations.
Other than that, functions are good.
Regards
- henrik
--
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-dev.
For more options, visit https://groups.google.com/groups/opt_out.