On Fri, Sep 7, 2012 at 9:10 AM, R.I.Pienaar <[email protected]> wrote:
>
> but what if you had something like this:
>
> class example::data {
> case $::ofamily {
> "RedHat": { $service = "httpd" }
> "Debian": { $service = "apache2" }
> default: { fail("Please specify a service name using hiera") }
> }
> }
>
> Here we clearly model different behaviours depending on the context and
> clearly state what we do not support via default but still alow the
> module user to then decide they would provide this override data
> through whatever hierarchy make sense for their site, ENC or just
> hardcoding it.
>
The data bindings can handle that by having the Debian and Redhat
cases in hiera (all of the facts are available to the data binding
service) and then the class would have:
class example($service = "UNKNOWN") {
if ($service == "UNKNOWN") {
fail("Please specify a service name")
}
}
I don't think this is quite as clear as the data class form, since
there is now no single place to look to understand the behavior.
>> separate data from code. The data bindings do this by extending the
>> language and providing an extension point in puppet where you can
>> plug in your own data lookup services. The puppet backend was a hack that
>> depended on knowledge about puppet that leaked through to the
>> implementation of the backend, which was never supposed to be
>> available. We made the decision to not continue leaking this
>> information in the data bindings code so that it would be less tied
>> to the internals of puppet. That had the effect of cutting off the
>> puppet backend, which we did not consider a problem since we wanted to
>> promote the pure data bindings going forward.
>
> I think the puppet backend far from being a hack was actually a major
> win for module authors and our ability to create reusable modules that
> work out of the box.
>
True. And the data bindings are trying to take a next step in that direction.
> I think the 'hack' aspect comes from the fact that puppet doesn't cleanly
> expose some of the data this backend would need hence the fake scope thing
> but conceptually I think if it was realised better this backend still has
> solid reason to exist and function
>
> Either way, if we are not going to support a puppet backend the pull
> request 1111 needs to remove that backend.
>
I'm not sure if we want to remove it yet, since it still works and a
lot of people are still using it. We would probably deprecate it
first. I would only want to do that if there was enough consensus that
the data bindings provide enough of an alternative solution.
So we are going to continue supporting the puppet backend via the
hiera functions. The data bindings will "work" with it in the sense
that it doesn't blow up (as it did the first time we tried a setup
with it enabled). At some point during the 3.x cycle it will probably
be deprecated as it becomes clear that its use cases are covered by
the data bindings, which might take some changes to the data bindings.
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Developers" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/puppet-dev?hl=en.
>
--
You received this message because you are subscribed to the Google Groups
"Puppet Developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-dev?hl=en.