On Tue, 24 Jul 2012 17:23:12 +0200 (CEST) linuxgurugamer wrote: n> We have several different types of servers, which can be grouped into several main groups. For this discussion, I'll refer to the following:
n> Group 1: web servers n> Group 2: database server n> I've been trying to implement a method to have a file on each system n> identify which group it belongs in. I'd like to be able to do it n> this way so that the CF-engine config won't have to be changed every n> time we add a new system. I started using the following method as a n> precursor to creating a development vs production environment on the n> same system. OK, so really you have dev-web, prod-web, dev-db, and prod-db. And this will keep growing, so you can't manage it with a new subdirectory for every subclass. n> So what I've done is to create the following directories on the cfengine server: n> /var/cfengine/masterfiles n> /var/cfengine/masterfiles-web n> /var/cfengine/masterfiles-db n> On the destination system, I created a file called: policy_suffix.dat, and put in the file the desired suffix for the system. My first suggestion is to have just one masterfiles directory. All your policy code should be in one place. My second suggestion is to set up one hub for each stage in your staging process. Then that hub would check out the right version of your code into masterfiles (you use version control, right?). I have an outstanding pull request against cfengine/core.git for a git-failsafe.cf which will make that task easier with Git: https://github.com/cfengine/core/pull/90 Third, you want to have a file on each node with a single class, basically. It's more fitting the cfengine model to have the hub's policy come down and tell the node what classes it belongs in. But you can try something like https://github.com/tzz/jim and grab the module output. Let me know if you want to know how to use that tool. Mike from LinkedIn posted about the way they organize their nodes, and it's fairly similar to what you're describing as far as staging and setting classes, except it's all done in policy without external files. Ted _______________________________________________ Help-cfengine mailing list Help-cfengine@cfengine.org https://cfengine.org/mailman/listinfo/help-cfengine