Forum: Cfengine Help
Subject: Re: Bundle and Body
Author: Nicolas Charles
Link to topic: https://cfengine.com/forum/read.php?3,18931,18932#msg-18932

Hi,

A bundle could be compared to a function. It is what you call to execute 
action. The list of the bundle you want to run is defined in the bundlesequence

In a bundle you get descriptions of the state you want to reach, separated by 
types (like vars, files, packages, ...)

For each type, you describe what you want to do
type:
  class::
    "promiser"
        attribute1 => body_or_value,
        attribute2 => body_or_value ...

A body will let you define more informations about the intent, and put all the 
details away (hide it in the wall, as Mark would say)


Exemple :

# This is the entry point of cfengine. You define the list of bundles to execute
body common control {
  bundlesequence  => { "copy" };
}

# This bundle will copy files
bundle agent copy {
 files:
    "/tmp/testfile1-cop" copy_from => mycopy("/tmp/testfile1", "gudea");
    "/tmp/testfile2-cop" copy_from => mycopy("/tmp/testfile2", "gudea");
}

# this is the description of how you want to copy the file
body copy_from mycopy(from,server) {
 source => "$(from)";
 #servers => { "$(server)" };
}


Regards
Nicolas

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

Reply via email to