On 16 feb 2011, at 20:44, [email protected] wrote:

> Forum: Cfengine Help
> Subject: .cf file includes?
> Author: bubble1975
> Link to topic: https://cfengine.com/forum/read.php?3,20701,20701#msg-20701
> 
> Greetings all,
> 
> I was wondering if there was a clean way of being able to simply include *.cf 
> in the "promises.cf -> inputs" stanza instead of hardcoding every single .cf 
> file you want to use specifically?  Sort of like an 'include directory' like 
> apache uses?  We're going to be adding a lot of unique .cf files, and the 
> list will get long, so I was hoping there would be a 'catchall' way to just 
> include them all...?
> 
> Or maybe a way to call a script that feeds 'ls /var/cfengine/inputs/*.cf" 
> into an slist variable or something, and then do:
> 
> inputs => {
>   "$(control.cf_file_list)"
> }
> 

this may work, it is used on one of our clusters:
{{{

bundle common global{
        vars: 

                "workdir" string => "/var/lib/cfengine3";
                "currentcf" string => execresult("/usr/bin/find 
$(workdir)/inputs/ -name *.cf ! -name promises.cf ! -name 
failsafe.cf","noshell");
                "cflist" slist => splitstring($(currentcf),"\n","50");
}

body common control {
        inputs => {
                @(global.cflist)
        };
}


--
Bas van der Vlies
[email protected]



_______________________________________________
Help-cfengine mailing list
[email protected]
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to