Forum: CFEngine Help
Subject: error passing slist from two dimension array
Author: milindk
Link to topic: https://cfengine.com/forum/read.php?3,25767,25767#msg-25767

Hi I am trying to pass slist variable from a two dimensional array to a bundle 
, the array consist of string and slist 
I can pass strings but having errors passing slist 

 cf-agent -K -f ./h.cf
 !! List parameter "${v}[$(LobName)]" not found while constructing scope 
"qbundle" - use @(scope.variable) in calling reference
R: ${@(${v}[$(LobName)])}



body common control
{
bundlesequence => { "configfiles" };
 inputs => { "/var/cfengine/masterfiles/cfengine_stdlib.cf" };
version => "1.2.3";
}
bundle common g
{
vars:

classes:


}

bundle agent configfiles
{
vars:
"dns" string => "abc.com jmk.net ymk.org";
"dns" string => "rotate";
"dns" slist => {"10.1.1.1" , "10.2.2.2"};
"dns" string => "ynt.com pjmk.net pymk.org";
"dns" string => "rotate";
"dns" slist => {"10.1.3.2", "10.2.2.2"};

methods:
  "any" usebundle => testbundle("configfiles.dns");
}

bundle agent testbundle(v)
{
vars:
"LobName" slist =>getindices("${v}");

"sectionname" slist => getindices("${v}[$(LobName)]");

methods:
#   "any" usebundle => 
qbundle("${v}[$(LobName)]","${v}[$(LobName)]","${v}[$(LobName)]");
   "any" usebundle => qbundle("@(${v}[$(LobName)])");


reports:
cfengine_3::

}

#bundle agent qbundle(m,j,k) {
bundle agent qbundle(m) {

vars:

reports:
cfengine_3::
"${${m}}";
#"${${m}},${${j}},${${k}}";
}

Am I doing something wrong here ?

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

Reply via email to