Jimmy Thrasibule
unread,Jul 9, 2014, 5:06:23 PM7/9/14Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to help-c...@googlegroups.com
Hi,
I was coming with this promises set:
body common control
{
bundlesequence => { "test" };
}
bundle agent test
{
vars:
"values"
slist => {
"a",
"b",
"c",
};
files:
"/tmp/cf-insert-test.txt"
create => "true",
edit_defaults => empty,
edit_line => insert_lines("$(values)");
reports:
cfengine_3::
"$(values)";
}
body edit_defaults empty
{
empty_file_before_editing => "true";
edit_backup => "false";
}
bundle edit_line insert_lines(v)
{
insert_lines:
"$(v)";
}
With the question "am I assured that my inserted lines will always be
inserted as defined in the slist"?
In fact I'm looking for the right structure to insert lines into a
file in an ordered manner.
However, when I run the promises above, the result is not what I was expecting:
$ cf-agent -K
R: a
R: b
R: c
$ cat /tmp/cf-insert-test.txt
c
As you can see, only the last value can be found in the file. Is this
normal behavior? What is the correct way to insert a slist into a
file.
Thanks for your help,
Jimmy