Forum: Cfengine Help
Subject: Re: Error when trying to define classes in "copy_from"
Author: dan
Link to topic: https://cfengine.com/forum/read.php?3,19044,19215#msg-19215

You probably need to define the on_change function. This would be something 
like the following:

body classes on_change(new_class)
{
promise_repaired => { "$(new_class)"};
}

This, combined with the classes => on_change("restartHttpd"), should cause the 
restartHttpd class to be defined. See this section in the cf3-reference for the 
other options you can use here: 
http://www.cfengine.org/manuals/cf3-reference.html#classes-in-_002a

You could also use the cdefine function from 
http://www.cfengine.org/manuals/cf3-reference.html#Familiiarizing-yourself if 
you wanted it to alert on failure.

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

Reply via email to