On 03/06/2015 04:12 PM, Nick Howes wrote:
> I'm aware there are no functions in the example, which would be
> implemented either as a `define` in Puppet or as a custom type in Ruby -
> I was just expressing that I'm open to any solution, which may involve
> some helper function under the hood.

That's why I was asking so intently. Please be aware that "functions" in
the context of Puppet are usually custom parser functions, which serve a
purpose that has nothing to do with providers whatsoever.

> Having written all this, I've
> learned that the `firewall-cmd` frontend to firewalld can be used to
> manipulate these files, so a solution might be to write a provider that
> drives this command rather than manage the files directly.

That sounds promising. Please verify carefully whether a "service" and a
"zone" really need to exchange any information. Your Puppet model should
ideally make it possible to represent a complete configuration through a
set of distinct resources, each of which is self-sufficient.

Puppet will manage relationships such as ordering and dependencies for
you, conveniently defined in the DSL, just as between all other
resources that Puppet can manage out of the box.

If you face difficulty devising such a model for your use case, feel
free to ask for help on this list.

Once you arrived at a design, I would advise to implement it using
define() and exec {} first. Once you have some manifests that
successfully use these defined types, you can consider if it's worth the
effort to implement actual native types and providers to do that work
more efficiently (mind you, that effort is substantial in comparison to
a manifest-only approach).

HTH,
Felix

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/54F9D275.6050106%40alumni.tu-berlin.de.
For more options, visit https://groups.google.com/d/optout.

Reply via email to