X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/261e7e9cd1a9882faa4ed7087b5902ebafe25988..80634e170fe2459bf4240835ed139cb0c3848c4c:/cookbooks/sysfs/recipes/default.rb?ds=sidebyside diff --git a/cookbooks/sysfs/recipes/default.rb b/cookbooks/sysfs/recipes/default.rb index b9b5faff3..f0290d4e7 100644 --- a/cookbooks/sysfs/recipes/default.rb +++ b/cookbooks/sysfs/recipes/default.rb @@ -31,3 +31,15 @@ template "/etc/sysfs.conf" do mode 0644 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