Forum: Cfengine Help
Subject: Re: Insertion of certain definitions, in predefined order
Author: pieterb
Link to topic: https://cfengine.com/forum/read.php?3,19085,19092#msg-19092

Alright, my Cfengine policy:

bundle agent printer2
{
vars:
 "printer_1" string => "This is a block of text
that contains multiple lines.

new code

Another new line.
";

 "printer_2" string => "This line is different from all lines that came before
this is a string
that contains multiple lines.

different code

Another new line.
";

files:

   "/etc/cups/printers.conf"

   edit_line => printers,
   classes => if_else("printers2_repaired","printers2__notrepaired");

bundle edit_line printers
{
insert_lines:
   "$(printer2.printer_1)";
   "$(printer2.printer_2)"
expand_scalars => "true";
}


Which results in the following file:

This is a block of text
that contains multiple lines.

new code
Another new line.
This line is different from all lines that came before
this is a string
different code



Which is not the behaviour I desired. (as lines are missing)

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

Reply via email to