X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/7b9ec4b60ee39614d1d083d7220e76b07d2b275f..fb13f19b005623db4d2ae0c1def422e885b048a9:/cookbooks/sysfs/recipes/default.rb?ds=sidebyside diff --git a/cookbooks/sysfs/recipes/default.rb b/cookbooks/sysfs/recipes/default.rb index c6eb15ff5..f0290d4e7 100644 --- a/cookbooks/sysfs/recipes/default.rb +++ b/cookbooks/sysfs/recipes/default.rb @@ -29,5 +29,17 @@ template "/etc/sysfs.conf" do owner "root" group "root" mode 0644 - notifies :restart, resources(:service => "sysfsutils") + notifies :restart, "service[sysfsutils]" +end + +node[:sysfs].each_value do |group| + group[:parameters].each do |key,value| + sysfs_file = "/sys/#{key}" + + file sysfs_file do + content "#{value}\n" + atomic_update false + only_if { File.exists?(sysfs_file) } + end + end end