Hi
I am writing a module that needs to
- download a number of files,
- run an index on them
- and restart the service to load the index.
I first thought I could make the download and index actions a cron job that I surface via class properties but because I want to notify the service when these cron jobs are done that won't work. The alternative solution is to run download and index as execs but that could cause a puppet run to take 15min or longer depending on the network connection. I am not keen for such a long running puppet run and was wondering if anyone has solved a similar problem and could share some code. Alternatively if there is a module on forge that solves a similar problem then I would very much appreciate a pointer to it, to see how it is done.
One possible solution would be to manually add in a service restart as part of the cron job entry that the module creates. That feels a bit clunky though.
Best Regares