Puppet:将整数更新为文件内容-对于类内容中的值0,Munging失败

Puppet:将整数更新为文件内容-对于类内容中的值0,Munging失败,puppet,Puppet,我正在尝试使用整数0更新内容。下面的文件资源 file { ['/sys/block/sda/queue/read_ahead_kb']: content => 0, } Error : Failed to apply catalog: Parameter content failed on File[/sys/block/sda/queue/read_ahead_kb]: Munging failed for value 0 in class content: no imp

我正在尝试使用整数0更新内容。下面的文件资源

file { ['/sys/block/sda/queue/read_ahead_kb']: 
    content => 0,

}

Error : Failed to apply catalog: Parameter content failed on File[/sys/block/sda/queue/read_ahead_kb]: Munging failed for value 0 in class content: no implicit conversion of Fixnum into String at /test/puppet/environments/mytest/modules/test/manifests/testdb/settings.pp:4
我所需要的只是有0在里面?我试图将引号之间的零作为字符串,但它不会更新文件,并抛出以下错误

错误1:

Error: Could not back up /sys/block/sda/queue/read_ahead_kb: Got passed new contents for sum {md5}102e7bda3ff4572145809d25da2bbe11
我删除了/var/lib/puppet/clientbucket并重新运行了puppet

错误2:

Error:/Stage[main]/testdb::Settings/File[/sys/block/sda/queue/read_ahead_kb]/content: change from {md5}102e7bda3ff4572145809d25da2bbe11 to {md5}cfcd208495d565ef66e7dff9f98764da failed: Operation not permitted @ dir_s_mkdir - /sys/block/sda/queue/read_ahead_kb20200315-47213-5b01k6.lock
有人能帮忙吗


谢谢

我强烈怀疑您不能使用
文件
资源来管理
/sys
中的特殊文件
/sys
可能看起来像一个文件目录,但实际上不是

有一些木偶模块可用于管理
/sys
设置。例如,这将允许您使用

include sysfs

sysfs::setting { 'class/block/sda/queue/read_ahead_kb':
  value => 0
}