First of all, thanks for your feedback. I'm still learning Chef, and I benefit from any advice on how to write better cookbooks.
That said, I'm not sure I understand your suggestion.
Let me start with a bit of an explanation about how bluepill works (note that I'm not a bluepill expert either, but I do have some experience with it).
- You create a service descriptor (a "pill"), which is a configuration file that's used by bluepill to know what to do (a bit like a SysV init or upstart script);
- Bluepill reads the file, starts the described service and monitors it;
- If the service is already running and I issue a "bluepill load" command, it re-reads the configuration and updates the service behaviour.
The third bullet is where the cookbook falls short. Since the service is already running, the :load action does nothing and the service keeps running with the old configuration, even though the pill file has changed.
Answering your questions:
- We do not, we actually do the opposite. If the service is running, we do not load the pill;
- This what I'm not sure I understand. That was the point of :force_load – to be notified by a template change and then load the pill even though @current_resource.running == true;
- The bluepill [re]load command takes care of updating the service.