Quantcast
Channel: Ask Puppet: Puppet DevOps Q&A Community - RSS feed
Viewing all articles
Browse latest Browse all 6104

FILE_LINE does not work when i want to add multiple line in a file

$
0
0
file_line{'sysctl': path => '/etc/mcp/templates/sysctl.conf_try', line => "\n# Settings done for Hardening\n# Disable kernel core dump\nkern.coredump=0", match => "^#[\s]+Settings[\s]+done[\s]+for[\s]+Hardening[\s]*[\n]+^#[\s]+Disable[\s]+kernel[\s]+core[\s]+dump[\s]*[\n]+kern.coredump", } Here I want to add 3 lines in file as below, if they does not exist. # Settings done for Hardening # Disable kernel core dump kern.coredump=0 It works fine, if those 3 lines are not present means at that time those 3 lines get added to file. But it does not work , when 3 lines are already present. In this case it is adding one more time those lines. So here it should not do anything.

Viewing all articles
Browse latest Browse all 6104

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>