I need to make a cf3 policy where the input of a bundle will consist
of 2 parameters out of /etc/inputparameter
The format of /etc/inputparameter will be

config1a:config1b
config2a:config2b
...

The question now is what is the preferred way of doing this
Should I create  2 set of execresult+splitstring which then call a
second bundle that has 2 input parameters, or should I use one
execresult+splitstring, and then pass it as a parameter to another
bundle which then will grab the second parameter, before finally
called the third bundle with two parameter?
The 2 set of execresult+splitstring method will be:
vars:
      "a_config" string => execresult("/bin/cat /etc/inputparameter |
/bin/cut -d: -f1", "useshell");
      "a"             slist  => splitstring( "${a_config}", "\n", "1000");
      "b_config" string => execresult("/bin/cat /etc/inputparameter |
/bin/cut -d: -f2", "useshell");
      "b"             slist  => splitstring( "${b_config}", "\n", "1000");

methods:
      "any"   usebundle => process_parameter("$(a)", "$(b)");

In essence the question is, if I use the 2 set of
execresult+splitstring way, will cf3 always guarantee the order of
parameter (eg: config1a will always be paired with config1b for the
first line, while config2a will always be paired as  config2b for the
second line)

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

Reply via email to