On Wed,  1 Aug 2012 12:00:00 +0200 (CEST) loopx wrote: 

n> To make some promise, I need to define classes like this :
n> - XXX_running
n> - XXX_stopped

n> But, I've seen that it's possible to define classes with built-in
n> methods of Cfengine3. In the community lib, I've tried to use
n> "if_else" but, it is always "yes" which win and print the final
n> report, even if the process is not running :

n> So, how should I do to only define a class if the process is running, and 
another class if the process is not running ???

It's pretty easy without if_else bodies and such, e.g. I do this for Splunk:

  processes:
      "splunkd" restart_class => "splunk_start";

  commands:
    splunk_start::
      "$(splunk_control) start --no-prompt --answer-yes --accept-license";

You don't need the inverse of the "splunk_start" context since it's easy
to use "!splunk_start" wherever you need it, but if you really want a
new redundant context, just use the not() function in a context
expression.

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

Reply via email to