Justin, what you are looking for is probably a new feature 
"ignore_missing_inputs"
and "ignore missing bundles". See the "bleeding edge" reference manual on the 
community site.

Justin Lloyd wrote:
> If a system may or may not have a specific file and you only want to
> evaluate the promise if the file exists, this is an example of the only
> way I can see to do that:
> 
> classes:
> 
>     "file_exists" expression => fileexists("/var/adm/kern.info");
> 
> files:
> 
>     file_exists::
> 
>         "/var/adm/kern.info"
> 
>             rename => rotate("5");
> 
> I was thinking that it might be nice to have something like an
> "optional" attribute that would ignore the promise if the file doesn't
> exist (maybe defaulting to "false"), simplifying such promises:
> 
> files:
> 
>     "/var/adm/kern.info"
> 
>         optional => "true",
>           rename => rotate("5");
> 
> Has anyone else thought about this or know of something that I might be
> missing? I'm setting up some log rotation (hence this particular
> example) and currently we have a number of such "optional" log files on
> many systems (but we're working on cleaning that up).
> 
> Thanks,
> Justin
> 

-- 
Mark Burgess

-------------------------------------------------
Professor of Network and System Administration
Oslo University College, Norway

Personal Web: http://www.iu.hio.no/~mark
Office Telf : +47 22453272
-------------------------------------------------
_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to