linux - How to edit a file and pass values into it through Puppet -


i want pass limit values in /etc/security/limits.conf in servers available in environment through puppet. need automated process whenever create new instance, limit values directly append new boxes

there's official puppet module modifying limits.

you use file_line this.

file_line { 'append_limits_conf':   path => '/etc/security/limits.conf',   match => 'variable_name',   line => 'vriable_name = foobar', } 

the match used determine if variable declared within file. if yes - change value whatever define @ line. if it's not in there append line.

more sophisticated file editing can done augeas - might overkill case right now.


Comments