On 12/05/2014 10:28 AM, Igor Galić wrote:
> * 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.

Hi,

I'm not sure that I fully understand a problem, but if at all possible,
I like to try and solve such things by generating additional resources.
The idea is roughly:
* add a generate hook to the trafficserver_storage type
* make it invariably generate a file resource for the directory
* depending on the agent platform, it can
 * generate file resources for the udev config
 * generate a service resource for the udev refresh

If the user manages any of those in their own manifest, the respective
resource will not be added to the catalog. This might be problematic, of
course. For the service reload, but you might be able to accomodate
using Trevors autonotify hooks.

As for the files, those might fail silently ("fail" only if the manifest
manages a state that is not sufficient for your type's needs;, otherwise
it will Just Work). You might want to raise exceptions if the files are
managed already, so that the user is aware of possible trouble. (You
could even inspect the resources in the catalog and raise very specific
problems that the user can address in their manifest.)

HTH,
Felix

-- 
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/5481894B.8040603%40alumni.tu-berlin.de.
For more options, visit https://groups.google.com/d/optout.

Reply via email to