Forum: CFEngine Help
Subject: Re: methods organization in the 'main' bundle
Author: sauer
Link to topic: https://cfengine.com/forum/read.php?3,25027,25043#msg-25043

I do multiple sub bundles.  I start by grouping promises into functional groups 
(user management, filesystem permissions, application configuration, misc 
hardening).  As in your example above, I have file names and bundles named 
similarly, so user management means there's a users.cf, and at the top of 
users.cf there's a bundle named users.  Then the users bundle contains just 
methods, which -(sticking with the users example) further breaks things down 
into things like groups, application accounts, human users, ssh keys, etc.  I 
try to make a bundle either a "meta bundle" with just methods or a "functional 
bundle" in general, so I don't have methods mixed with other promises (other 
than possibly vars and classes).  I usually even do a  "user_vars" and 
"user_classes" sub-bundle (in the case of users) to group common definitions 
together and keep the methods bundle clean.

Then again, I come from a programming background, and the include files / 
methods stuff feeds my compulsion to treat CFEngine like a traditional 
procedural programming language - despite Mark's pleas to the contrary. :)  But 
I think the end result does align with the goal of having a high-level 
description of what's being done, while being able to peel back the layers to 
get more and more detail as needed.

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

Reply via email to