On Fri, Jan 27, 2012 at 08:58:35AM -0500, no-re...@cfengine.com wrote:
>Forum: CFEngine Help
>Subject: bundles: can a class argument be passed?
>Author: davidlee
>Link to topic: https://cfengine.com/forum/read.php?3,24675,24675#msg-24675
>
>(cfengine community 3.1.4; RHEL 5.x)
>
>When writing a bundle with arguments (parameters), the descriptions and 
>examples in the ref. manual seem to be about the arguments being 'vars'.  But 
>can an argument be a 'class'?


I don't think so.

However, two possible workarounds occur to me:

1) Pass a variable, and use ifvarclass.
2) Pass a variable, and use a classes: promise based on the contents to
set a class.

(Both untested...)


>
>For instance:
>
>bundle cf-agent my_bundle(class_arg)
>{
>  vars:
>    class_arg::
>      "var_local" string => "true";
>
>    !class_arg::
>      "var_local" string => "false";
>
>  reports:
>    "The class argument is $(var_local)";
>}
>
>
>(Naturally, the real-life case would be something more substantial than that 
>'reports:' example.)
>
>If this is possible, could you also let me know where it is documented, as I 
>must have missed it.
>
>_______________________________________________
>Help-cfengine mailing list
>Help-cfengine@cfengine.org
>https://cfengine.org/mailman/listinfo/help-cfengine

-- 
Jesse Becker
NHGRI Linux support (Digicon Contractor)
_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to