Forum: CFEngine Help
Subject: Re: An advanced policy using template and variable substitution
Author: toddnni
Link to topic: https://cfengine.com/forum/read.php?3,24105,24132#msg-24132

My suggestion in the first post would also keep the comments, but after all 
this approach is unnecessary because you are using edit_defaults => empty (as I 
tried to explain in the second post).

You can use if_repaired and backup with edit_line promise too

   295          linux::
   296                  "/etc/sysctl.conf"
   297                          handle                  =>      
"linux_build_sysctl",
   298                          create                  =>      "true",
   299                          perms                   =>      
mog("0644","root","root"),
   300                          edit_line                       =>      
edit_sysctl_conf("@(build_etc_sysctl_conf.kernel_tunables)"),
   301                          edit_defaults           =>      
empty_and_backup,
   302                          classes                 =>      
if_repaired("sysctl_conf_modified");

with

body edit_defaults empty_and_backup
{
empty_file_before_editing => "true";
edit_backup => "true";
}


I see you have thought about your bundle a lot and I believe it works fine. I 
just wanted to comment, because I have done something similar and I am 
interested how do you reason your choices.

_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to