On Thu, Sep 23, 2010 at 3:29 AM, Francisco Reyes <li...@stringsutils.com>wrote:

> With lots of help from Michael Ciavarella I got an initial test setup
> going.
> The first thing that became obvious is that there wasn't a straightfoward
> way to define groups of machines for receiving certain tasks/files.
>

Actually it is really straightforward.


>
> Looking at the official tutorial at
> http://www.cfengine.org/manuals/cf3-tutorial.html#Decisions I see that one
> can do something like:
> "alt_class" or => { "linux", "solaris", fileexists("/etc/fstab") };
>
> Could one just use fileexists to define classes to target different machine
> types?
>
> For example creating:
> /cfengine-machine-type-smtp
> /cfengine-machine-type-web
> /cfengine-machine-type-db
>
> So each type of machine would only have one of the 3 files and then I would
> use fileexists to define the proper soft class for the machine.
>
> Is that a reasonable approach or is there some other better way to have
> groups of types of machines?
>


The approach you describe is technically possible, whether or not it is
reasonable for your environment is up to you to decide. Cfengine is very
flexible and you can approach problems from many angles, you just have to
work out which one is right for you.

Personally, I use regcmp() to build classes that represent different groups
of machines - this works well for me because all my server hostnames are
very descriptive and indicate 1) the machine role (e.g. webserver,
data-server) 2) the machine location (which datacentre) and 3) whether the
machine is dev, test  or prod. So I end up with classes like:

web-servers:: # all web-servers in all location at all levels
test-servers:: # all test servers
dc-loc1:: # all servers in data centre1

The problem you may encounter is that while it is very easy to define new
classes (and combinations thereof), it is very hard to build and extend
slists based on new class combinations. Hopefully this will change soon.



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

Reply via email to