Fellow Humans!

i would like solicit your expert knowledge in designing a type & provider for
Apache Traffic Server's 
[storage.config](http://trafficserver.readthedocs.org/en/latest/reference/configuration/storage.config.en.html)

The basic outline of my general idea, which i implemented with finch's
Filemapper, and finch's help(!) can be found here:

type: 
https://github.com/Brainsware/puppet-trafficserver/blob/types/lib/puppet/type/trafficserver_storage.rb
provider baseclass: 
https://github.com/Brainsware/puppet-trafficserver/blob/types/lib/puppet/provider/trafficserver_storage.rb
 (literally, a class, this was finch's idea ;)
provider for linux: 
https://github.com/Brainsware/puppet-trafficserver/blob/types/lib/puppet/provider/trafficserver_storage/udev_storage.rb

(ignore it for now;)

now the problem that i'm trying to solve is as follows:

storage.config *drives* the configuration process: when it changes, *something*
on the system changes too. this could either mean a

* directory needs to be created and chowned to the correct user
* udev|devfs entry needs to be made and udev needs to be reloaded

the first case is easy and platform independent (i.e.: it works on all Unix
platforms equally, and traffic server only runs on Unix, so it's fine ;)

the second case however is more problematic as it means we need to keep two
syntactically distinct files in sync. it also means that we need to verify, and
possibly recreate that secondary file if *nothing* in the primary file at all
has changed.

now, from what i gather, a provider cannot be split on a line-by line basis,
but maybe i'm wrong there. in my design above i integrated the directory case -
as an if statement - into the base provider. Considering all the things i've
learned about refactoring in the past three months, this strikes me now as a
profoundly bad move ;)

as for the second case, at least with filemapper, this is really hard to do:
the udev/devfs files would have to be handled in ruby, rather than in
filemapper, if i use inheritance.

and so i'm stuck, and would like some advise on how to handle this properly.

thank you very much in advance.


-- o/~ i
Igor Galić

Tel: +43 (0) 664 886 22 883
Mail: i.ga...@brainsware.org
URL: http://brainsware.org/
GPG: 8716 7A9F 989B ABD5 100F  4008 F266 55D6 2998 1641

-- 
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 puppet-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-dev/122470397.139030.1417771731123.JavaMail.zimbra%40brainsware.org.
For more options, visit https://groups.google.com/d/optout.

Reply via email to