Uploaded image for project: 'CFEngine Community'
  1. CFEngine Community
  2. CFE-3606

Make it easier to run policy with a specific list of inputs on demand

    XMLWordPrintable

    Details

      Description

      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 -file option to cf-agent and friends understand the file as a single file, it can't be separated with commas like classes via -define.
         cf-agent -KIf ./1.cf,./2.cf
           error: There is no readable input file at './1.cf,./2.cf'. (stat: No such file or directory)
        

      It would be nice if there were an option allowing multiple files to be specified for inputs.

      Perhaps -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.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              a10042 Nick Anderson
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:

                Summary Panel