-template "/etc/sysctl.d/60-chef.conf" do
- source "chef.conf.erb"
- owner "root"
- group "root"
- mode 0o644
- notifies :run, "execute[sysctl]"
-end
+ Dir.new("/etc/sysctl.d").each_entry do |file|
+ next unless file =~ /^99-chef-(.*)\.conf$/
+
+ keys.push(Regexp.last_match(1))
+ end
+
+ node[:sysctl].each_value do |group|
+ group[:parameters].each do |key, value|
+ sysctl key do
+ value value
+ # comment group[:comment]
+ end