On Thu, Oct 09, 2014 at 05:21:46PM -0500, The BSD Dreamer wrote:
>> copy_from => remote_dcp( "${src}", "@{ps.policy_servers}" );
>>
>> "${dest}"
>> comment => "Promise contents from template",
>>
>> Actual error, which comes from cf-agent. Cf-promises reports no error.
>>
>> cf3> -> Negated classes = {}
>> /var/cfengine/inputs/library.cf:884:0: error: In attribute 'servers', Scalar
>> value is out of range
>> Fatal CFEngine error: Cannot continue
>>
>
>My fuzzy memory says there was a way to pass a list to a scalar, but maybe I
>was dreaming....
>
>Using "${ps.policy_servers}" is probably the wrong kind of iteration here...so
>does that mean mean a new body like:
>
>body copy_from remote_dcps(from, servers)
>{
>source => "${from}";
>servers => { "@{servers}" };
>compare => "digest";
>}
It's possible that the line 884 is referring to the file where
remote_dcp body is (lib/3.5/
files.cf). That line is
body copy_from remote_dcp(from,server) # line 884
{
servers => { "$(server)" };
source => "$(from)";
compare => "digest";
}
But, I still don't see why this is an error. I pass @{list} to other
copy_from bodies without errors. Look at this example:
body common control
{
bundlesequence => { "main", };
}
bundle agent main
{
vars:
"servers" slist => { "172.16.0.2", "172.16.0.3" };
methods:
"any" usebundle => test;
}
bundle agent test
{
files:
"/tmp/nhw.test1"
comment => "List does not exist!",
copy_from => remote_dcp( "/tmp/bar", "@(main.server)" );
"/tmp/nhw.test3"
copy_from => remote_dcp( "/tmp/bar", "@{main.servers}" );
}
body copy_from remote_dcp(from,server)
{
servers => { "$(server)" };
source => "$(from)";
compare => "digest";
}
This does not produce an error like the one in my original post, even with the
intentional non existing slist.