Forum: CFEngine Help Subject: Re: Concatenating multiple files Author: SteveJake Link to topic: https://cfengine.com/forum/read.php?3,27049,27060#msg-27060
Thanks Neil, I've looked at templates, but they don't quite meet the need here. We've built a model where we use the existence of a file with a given class name at the end to drive the application of that file. i.e. if there is a hosts.foo file and the system that's currently running is in the foo class, then that system will grab hosts.foo as its hosts file. What we're trying to do now is to allow systems to belong to multiple classes. So, if there was a hosts.foo and a hosts.bar, and a system was part of both the foo and bar classes, its hosts file would be a concatenation of hosts.foo and hosts.bar. To use a template, I need to include in that template file all possible classes and the snippets of the files which would apply for those classes. This will create a very large template file as we have dozens of classes. Then editing that file could affect things for every class. If we go with the individual files for each class, we gain the benefits of having smaller and more easi ly managed files, where the risk of human error is much smaller as any given mistake will only affect that class of hosts, rather than potentially affecting all hosts. We also have process around the distinction between 'code' and 'data', where changes to code require approval of the Change board, and changes to data don't. The individual files would be classified as data as they would have no cf-engine promises in them and therefore could be changed easily. We haven't implemented anything with templates yet as we're running CFEngine 3.2.1 and we're not quite ready to upgrade across the board yet. thanks! -steve j _______________________________________________ Help-cfengine mailing list Help-cfengine@cfengine.org https://cfengine.org/mailman/listinfo/help-cfengine