It can be a bit annoying when working on a policy that uses policy from other files.
I can use inputs in body file control to include other files but when the other files needed are from the stdlib it's easy to run into issues.
- sys.libdir resolves to the full path of the dir where the stdlib is expected to be found. When running this is the same as sys.inputdir/lib, when running as root this is /var/cfengine/inputs/lib, but when running unprivileged (as I like to begin development) this is /home/user/.cfagent/inputs/lib. it's a bit limiting to have to keep that location in sync with whatever policy set I am working on.
- def.json allows me to specify inputs, but it's a separate file, and I have to put it next to the policy entry
- the -
fileoption to cf-agent and friends understand the file as a single file, it can't be separated with commas like classes via -define.
It would be nice if there were an option allowing multiple files to be specified for inputs.
file could start using commas like other options for multiple values? Or perhaps files which does understand comma as a separator could be implemented. And the entry point could be the first file specified, or the one specified with file with supplemental inputs from files. Or if -file gains understainding of comma, I guess it could be the first one specified.