help-cfengine
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Activating strategies by class?


From: Alexander Jolk
Subject: Activating strategies by class?
Date: Thu, 14 Apr 2005 21:39:02 +0200

Hi,

I'm playing around with strategies on cfengine 2.1.13, and I want to
activate one strategy depending on whether a particular class is
defined.

(As a matter of fact, I'm trying to distribute my machines over
different servers, and the choice of the server is made by a strategy,
and now I want the secondary servers to be taken into account only when
cfengine is run from cfexecd.)

What does not work:
strategies:
   from_cfexecd::
      { server_select
      server_primary: "2"
      server_secondary1: "2"
      server_secondary2: "2"
      }
   !from_cfexecd::
      { server_select
      server_primary: "1"
      }

(This would have appeared to me to be the most logical way to do
things.)

What does also not work:
control:
   from_cfexecd::
      secondary_weight = ( 2 )
   !from_cfexecd::
      secondary_weight = ( 0 )

strategies:
      { server_select
      server_primary: "2"
      server_secondary1: "$(secondary_weight)"
      server_secondary2: "$(secondary_weight)"
      }

(This gives an error message `strategy distribution weight must be an
integer'.  That would have been my second choice.)

I should be able to get around this limitation by using
`from_cfexecd|server_primary' and `!from_cfexecd.server_secondary', but
that strikes me as a little less elegant.

Alex



-- 
Alexander Jolk         /         BUF Compagnie
tel +33-1 42 68 18 28 /  fax +33-1 42 68 18 29




reply via email to

[Prev in Thread] Current Thread [Next in Thread]