cfengine / design-center

CFEngine community-contributed content
http://cfengine.com/
Other
80 stars 68 forks source link

Expose runfile template for comments, etc. #392

Closed linuxgurugamer closed 10 years ago

linuxgurugamer commented 10 years ago

This would be very useful to allow a comment which, for example, would tell people not to edit the file since it is autogenerated by the design center

tzz commented 10 years ago

The runfile template lives in source code. It should be quite easy to expose it, and even to let the user fill it with parameters, but I won't be able to do it this week, sorry. I'll do it ASAP.

tzz commented 10 years ago

I added this as a parameter under runfile. The following is straight from the API docs in https://github.com/cfengine/design-center/blob/master/howto/dc_api.md

runfile

...

If you specify the string header under runfile, it will be inserted before any other comments (so you can have, for instance, a comment).

Full config.json example

{
 log: "STDERR",
 log_level: 4,
 repolist: [ "~/.cfagent/inputs/sketches" ],
 recognized_sources: [ "~/source/design-center/sketches" ],
 runfile: { location: "~/.cfagent/inputs/api-runfile.cf",
            standalone: true,
            header: "# This file is maintained by CFEngine",
            relocate_path: "sketches",
            filter_inputs: [ "some bad file" ],
            standalone_inputs: [ "extra.cf" ]
          },
 vardata: "~/.cfagent/vardata.conf",
}