On Tue, 21 Feb 2012 12:54:44 +0100 (CET) rsdejo...@gmail.com wrote: n> I have a question , n> We want to copy the repository files to rhel 5 + 6 and sles 9 / 10 / 11 n> I know how to divide into OS ,but how do you divide further in the tree ? n> example => /etc/yum.repos.d/baseline.repo
n> It's going to look like this n> rhel => version 5 => i386 n> rhel => version 5 => x86_64 n> rhel => version 6 => i386 n> rhel => version 6 => x86_64 n> same thing for sles but different location. Hi Rob, this was one of the first problems I had with cfengine when I started using it in 1998! I have looked for solutions over the years and have found three ways to manage the situation: 1) use a hierarchy, starting at $ROOT $ROOT/a.conf = global a.conf $ROOT/i386/a.conf = a.conf override for i386 $ROOT/i386/rhel5/a.conf = a.conf for RHEL5 on i386 Benefits: easy to understand and version. Downsides: can be ambiguous (how do you pick between a/b/c and a/c/d for a system that has classes a, b, c, and d?). Needs a special tool to pick the right config file. 2) use a flat structure, encoding the class in the name $ROOT/a.conf $ROOT/a.i386.conf $ROOT/a.rhel5.i386.conf This is similar to (1), just different layout and easier to grep and manage. 3) stitch the files with templates or with cfengine editfiles Benefits: easy to write, everything can be in the policy. Downsides: hard to manage big files, policy is harder to read, can be fragile if written carelessly. None of these three is ideal, but since the first one requires infrastructure, I usually use some combination of the other two at first, then transition to a hierarchy if the number and variety of files warrants it. Ted _______________________________________________ Help-cfengine mailing list Help-cfengine@cfengine.org https://cfengine.org/mailman/listinfo/help-cfengine