Hi, Everyone, I want to edit a config file, which needs to replace a couple
of lines with another couple.
It seems that the edit_line => replace_lines can only replace a couple of
lines with one string.
I try to pass a slist to it, such as that:
bundle agent replace()
{
vars:
"patterns" slist => { "This", "is", "test"};
"lines" slist => { "111", "222" ,"333"};
files:
"//test/test.txt"
edit_line => replace_lines("@(replace.patterns)",
"@(replace.lines)");
}
bundle edit_line insert_lines(lines)
{
insert_lines:
"$(lines)";
}
It replaces all elements of "patterns" with "111", but i want to replace
"This" with "111", "is" with "222" and "test" with "333".
Any suggestion ?
--
System Administrator, Focus on System Management and Basic Development
_______________________________________________
Help-cfengine mailing list
[email protected]
https://cfengine.org/mailman/listinfo/help-cfengine