Forum: Cfengine Help
Subject: preserve_block always sets repaired flag?
Author: babudro
Link to topic: https://cfengine.com/forum/read.php?3,19098,19098#msg-19098
Can anyone explain this behaviour? Is it a bug or is there a good reason I'm
not catching?
(snip)
files:
"/etc/hosts"
comment => "Maintain /etc/hosts file",
create => "true",
edit_line => hosts,
edit_defaults => empty;
(snip)
bundle edit_line hosts {
insert_lines:
"# hosts file for $(jdi.long_hostname)
#
# This file is consulted before DNS and must contain the server's name.
# Cfengine manages this file. Manual changes will be expurgated.
127.0.0.1 $(jdi.long_hostname) $(jdi.short_hostname) localhost
::1 localhost6.localdomain6 localhost6
",
insert_type => "preserve_block";
}
With insert_type => "preserve_block" the file gets re-written every time (i.e.,
Cfengine thinks it was repaired even though nothing changed).
If I remove the preserve_block, then it behaves as I would expect, i.e., it is
not re-written every time.
Ideas?
_______________________________________________
Help-cfengine mailing list
[email protected]
https://cfengine.org/mailman/listinfo/help-cfengine