Forum: Cfengine Help
Subject: Re: Behaviour change in 3.1.4
Author: phnakarin
Link to topic: https://cfengine.com/forum/read.php?3,21358,21364#msg-21364
You got a plain string in return so my guesswork is an array was not in place.
I urged you to workaround a bit to populate an array outside edit_line bundle
and parameterize to the bundle later on. For example;
bundle agent test
{
vars:
"pw" int =>
readstringarray("rpw","$(sys.workdir)/ppkeys/rootpw.txt","#[^\n]*",":","1","200");
files:
"/etc/shadow" edit_line => maintain_rootpw("$(rpw[1])");
}
bundle edit_line maintain_rootpw(passwd)
{
field_edits:
"root:.*"
# Set field of the file to parameter
edit_field => col(":","2","$(passwd)","set");
}
Then we can tell firmly that there is a bug on vars: in edit_line bundle.
Cheers,
--Nakarin
_______________________________________________
Help-cfengine mailing list
[email protected]
https://cfengine.org/mailman/listinfo/help-cfengine