bundle agent main
{
vars:
"list" slist => { "1", "2", "3" };
"var_list" string => "list";
methods:
"array" usebundle => test( "@{${this.bundle}.${var_list}}" );
}
bundle agent test(input)
{
reports:
"${input}";
}
[root@enc ~]# cf-agent --version
CFEngine Core 3.5.3
[root@enc ~]# cf-agent -Kf ./var.cf
2014-05-24T00:14:40-0100 notice: R: 1
2014-05-24T00:14:40-0100 notice: R: 2
2014-05-24T00:14:40-0100 notice: R: 3
[root@enc ~]# rpm -U cfengine-community-3.6.3rc-1.x86_64.rpm
Shutting down cf-execd: [FAILED]
Shutting down cf-serverd: [FAILED]
Shutting down cf-monitord: [FAILED]
[root@enc ~]# cf-agent -Kf ./var.cf
2014-05-24T00:26:43-0100 error: /default/main/methods/'array'/default/test: List or container parameter '${this.bundle}.${var_list}' not found while constructing scope 'test' - use @(scope.variable) in calling reference
R: @{main.${var_list}}