[英]How to edit a file and pass values into it through Puppet
我想通过puppet在环境中可用的所有服务器中的/etc/security/limits.conf中传递限制值。 每当我创建新实例时,都需要使该过程自动化,该限制值会直接附加到新框中
有一个官方的人偶模块用于修改限制。
您也可以使用file_line 。
file_line { 'append_limits_conf': path => '/etc/security/limits.conf', match => 'variable_name', line => 'vriable_name = foobar', }
match将用于确定变量是否已在文件中声明。 如果是,它将值更改为您在line定义的任何值。 如果它不在其中,则将追加该行。
match
line
可以使用Augeas进行更复杂的文件编辑-但对于您而言,这可能已经过时了。
[英]How to pass multiple values in exec command resource in puppet?
[英]puppet create_resources pass multiple values
[英]How to test for existence of a file on the Puppet Master
[英]How to use a template for configuration file in Puppet
[英]Unable to edit file through sudo permission
[英]Edit a js file through shell script
[英]How to change content between [block] of puppet file with sed?
[英]How to edit proc file?
[英]How to edit a big file
[英]How to edit gitignore file
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.