Youscribe/sysctl-cookbook — pull request #7 by nvwls (2013-09-12 04:48:42+00:00)
Title: Major overhaul

I know this a big merge. It was my intent to address several short comings in the existing code.

1. You no longer have to specify include_recipe before using the LWRPs. As long as cookbooks depend on sysctl, when one invokes sysctl or sysctl_mutli, sysctl::default will be included if it is not already in the run list.
2. sysctl and sysctl_multi use the same template to render the conf file.
3. Allow one to override the cookbook and source of the template in the lwrp. We have some sysctl settings delivered from vendors, this allows us to check these in as templates instead of having to translate them into node attributes. Sure, we could lay them down separately the rationale will become clearer in points 4 and 5.
4. Reworked nagios['sysctl'] conf file generation to be a sysctl LWRP.
5. Added zap_sysctl_d to remove conf files no longer applicable. Your existing 'remove old files' resource kind of addressed this from a node attribute stand point. However, the current implementation would remove the files, recreate them, and load them every chef client run. If you remove a sysctl resource, it will get removed from the system. If one have some conf files not laid down by LWRP, one can create a dummy resource, i.e. action \:nothing, to keep zap_sysctl_d from removing them.
6. Given the priority nature of /etc/sysctl.d structure, one can layer settings. For example, one may have a 00-base.conf that disables ip forwarding among other things. There may be a 60-proxy.conf the enables forwarding. If one changes something in 00-base, it would get reloaded thus disabling forwarding. Since 60-proxy didn't change, it wouldn't get reload thus leaving forwarding disabled. This is not the behavior expected. I remedied this by always notifying the full sysctl-p to run.