ich durch Marionette, um sicherzustellen, müssen, dass die Datei /etc/logrotate.conf
den Eintrag haben mussPrüfung und fügen Sie mehrere Zeilen in Puppen
/var/log/secure {
monthly
rotate 11
}
Ich versuchte
$line_string = "/var/log/secure {
monthly
rotate 11
}"
file_line {'ensure correct entry in /etc/logrotate.conf':
path => '/etc/logrotate.conf',
line => $line_string,
match => $line_string,
}
Es den Eintrag erstellt das erste Mal, aber wenn Ich gebe den Puppencode ein zweites Mal an und fügt den Eintrag erneut hinzu.
[~] # puppet apply /home/vijay/logrot.pp
Notice: Compiled catalog for lxv9824 in environment production in 0.10 seconds
/var/lib/puppet/lib/puppet/provider/file_line/ruby.rb:36: warning: regexp has invalid interval
/var/lib/puppet/lib/puppet/provider/file_line/ruby.rb:36: warning: regexp has `}' without escape
Notice: /Stage[main]/Main/File_line[ensure correct entry in /etc/logrotate.conf]/ensure: created
Notice: Finished catalog run in 0.06 seconds
[~] # more /etc/logrotate.conf
/var/log/secure {
monthly
rotate 11
}
/var/log/secure {
monthly
rotate 11
}
Wie kann ich prävenieren? nt Marionette, den Eintrag ein zweites Mal hinzuzufügen?
Haben Sie darüber nachgedacht, stattdessen eine Datei in /etc/logrotate.d zu speichern? – daxlerod