On 7/12/10 10:35 AM, "[email protected]" <[email protected]> wrote: > Forum: Cfengine Help Subject: Help with basic cfengine topics Author: > mwlarsen Link to topic: > https://cfengine.com/forum/read.php?3,17687,17687#msg-17687
I'm not a > programmer, and I'm having some difficulty wrapping my mind around certain > topics discussed in the tutorials and guides. I was wondering of someone could > explain them in non-programmer terms. Version control in relation to cfengine > deployments: What, exactly, should be under version control? Only the central > promises.cf that resides on the policy server? Or everything that goes under > /var/cfengine/inputs on the policy server? Or some other set of files? We version everything under inputs, modules, and ultimately any content required by our services (e.g. configurations, SSL certs, etc). How far you want to go often depends on the size of your network and team. That said, even a team of one will generally benefit from pushing all content into revision control. http://www.infrastructures.org/bootstrap/version.shtml > *.cf > files sections: Why does it seem like there's a lot of redundancy in the > cfengine's .cf files? For example, from one of the tutorials: bundle agent > testcopy { files: "/home/aleksey/testcopy1" copy_from ⇒ > my_copy_body_with_options("/home/aleksey/testcopy2","192.168.1.10"); } body > copy_from my_copy_body_with_options(sourcefile,sourceserver) { Why is > there: copy_from ⇒ > my_copy_body_with_options("/home/aleksey/testcopy2","192.168.1.10"); and bod > y copy_from my_copy_body_with_options(sourcefile,sourceserver) Why not > just: bundle agent testcopy { files: "/home/aleksey/testcopy1" body copy_from > my_copy_body_with_options("/home/aleksey/testcopy2","192.168.1.10"); } I fail > to see what you get by saying it twice. Others can likely provide more interesting detail, but abstracting a bit generally allows for re-use. Avoiding the desire to hard code elements such as the file name and server address creates "functions" which can be called as needed, saving typing and increasing readability. I do tend to agree that the usefulness of some of this stuff becomes less obvious in contrived/minimalistic examples (that is not a problem specific to cfengine). > What does the term "scope" mean as > used in various tutorials that are out there? An example is from one > published at Linux Mag here: http://www.linux-mag.com/id/7802/2/ in relation > to this line: edit_line => resolvconf("iu.hio.no > cfengine.com",@{checkresolver.resolvers}); It says, "Note: we have to > reference the @resolvers array using its full name, @checkresolver.resolvers, > otherwise resolvconf will fail to find a @resolvers array within its own > scope. The @resolvers array is in the scope of “checkresolver{}” Any clarity > would be appreciated. http://en.wikipedia.org/wiki/Scope_(programming) _______________________________________________ Help-cfengine mailing list [email protected] https://cfengine.org/mailman/listinfo/help-cfengine
