目前/etc/puppet/modules/sysctl下
files:
sysctl.conf

manifests:
init.pp

templates:

sysctl.conf内容不多说,就是你要统一的,用我那本书里的配置就行,博客里有

文件init.pp里的内容为
class sysctl {
   file {"/etc/sysctl.conf":
       mode => 644, owner => root, group => root,
       ensure => present,
       source =>"puppet://$puppetserver/modules/sysctl/sysctl.conf";
   }


   exec {"exec-sysctl":
       command => "/sbin/sysctl -p /etc/sysctl.conf >/dev/null &",
#        path => "/sbin:/bin:/usr/sbin:/usr/bin",
#        user => root,
       subscribe => File["/etc/sysctl.conf"] ,
       require => File["/etc/sysctl.conf"],
       refreshonly => true
}

}


command => "/sbin/sysctl -p /etc/sysctl.conf >/dev/null &",这一行一定要有,因为文件传过去后不会立刻生效,所以要加上这句才可以立刻生效。

这样这个模块就可以了,加到相应的位置即可(因为我们的puppet整体部署的格局可能不同)