Hi, cf-agent, used with the -I option and the attached test.cf file, displays:
R: foo1 R: bar1 which is fine. But, if I switch the commented and uncommented ifvarclass lines, I get: !! Redefinition of a constant list "foo" cf3 -- Was {'cf_null','cf_null'} now {'foo1','bar1','@(foo2)'} Promise (version not specified) belongs to bundle 'test' in file '/home/baudoin/.cfagent/inputs/test.cf' near line 19 !! Redefinition of a constant list "foo" cf3 -- Was {'cf_null','cf_null'} now {'foo1','bar1','@(foo2)'} Promise (version not specified) belongs to bundle 'test' in file '/home/baudoin/.cfagent/inputs/test.cf' near line 19 for something that seems quite similar. In fact, I'm using several lists in a larger configuration, whose names are built from string variables and each list is defined only if a certain class exists and I need to use ifvarclass because the names of the classes are not fixed (they also depend on variables). Then I gather all the existing lists (hence the ifdefined policy) in another list. Still using Cfengine community edition 3.1.1. Any idea? -- Marc Baudoin STG Interactive
body common control { bundlesequence => { "test" } ; } bundle agent test { vars: "three" string => "3" ; "foo1" #ifvarclass => "cfengine_$(three)" , ifvarclass => "cfengine_3" , slist => { "foo1" , "bar1" } ; "foo" policy => "ifdefined" , slist => { @(foo1) , @(foo2) , } ; reports: cfengine_3:: "$(foo)" ; }
_______________________________________________ Help-cfengine mailing list Help-cfengine@cfengine.org https://cfengine.org/mailman/listinfo/help-cfengine