Standalone bundles in Cf3
03 Dec 2012I always seem to forget how to do this, but it's actually pretty simple. Assume you want to test a new bundle called "test", and it's in a file called "test.cf". First, make sure your file has a control stanza like this:
body common control {
inputs => { "/var/cfengine/inputs/cfengine_stdlib.cf" } ;
bundlesequence => { "test" } ;
}
Note:
inputs
must not include the file "test.cf" itself -- otherwise, you'll get the error "Redefinition of body "control" for "common" is a broken promise, near token '{'. Think of "inputs" as really being named "additional inputs".I'm including the cfengine_stdlib.cf file. You should too.
bundlesequence
is set to your bundle (which I'm leaving out of this entry for simplicity).
Second, invoke it like so:
sudo /var/cfeing/bin/cf-agent -KI -f /path/to/test.cf
Note:
-K
means "run no matter how soon after the last time it was run."-I
shows a list of promises repaired.-f
gives the path to the file you're testing.
Add a comment:
Name and email required; email is not displayed.
Related Posts
QRP weekend 08 Oct 2018
Open Source Cubesat Workshop 2018 03 Oct 2018
mpd crash? try removing files in /var/lib/mpd/ 11 Aug 2018