Forum: Cfengine Help Subject: Re: How to modify a global list Author: sauer Link to topic: https://cfengine.com/forum/read.php?3,21589,21602#msg-21602
So, this is related to a difficulty I'm having in some enterprise adminastration as well. Cron is a pretty good example. We have some cron job which should run on all hosts. But we also have a few other commands which should run on linux hosts, a few commands which should run on hosts which have a specific database installed, some other commands which should run if the hostname starts with "ab", and some commands which should run on specific hosts. The solutions usually use a list of strings which should be appended if they don't exist. But how does one define a list - in a manageable way - which can address the above situation? Yeah, I can define @linux_commands, @global_commands, @db commands, etc. Then what? I have to do a *bunch* class combinations like linux&dbhost&!abhost, linux&abhost&!dbhost, linux&dbhost&abhost, etc. just to make sure I only define the list of strings once. That somewhat works if I only have three kinds of machines, but really doesn't scale up very well. :) There's an enhancement request https://cfengine.com/bugtracker/view.php?id=240 related to appending to lists, which would address this, but how are people solving the problem now? Do people just put the files and commands sections into a bundle, and then reference the bundle repeatedly with each list? On a related note, I'd be marginally concerned about the problem which would happen if you later change the time on a command; there's no part of the "append lines" promise which removes an entry with the same command but a different time. That'd be hard to solve in a generic fashion, but I'd like to suggest that a cookbook include a comment noting that. :) _______________________________________________ Help-cfengine mailing list Help-cfengine@cfengine.org https://cfengine.org/mailman/listinfo/help-cfengine