Mark,
Those are great to know about, but I'm not sure they apply to my
problem. The example I gave was a simplification where the actual files
promises are actually interations over an slist variable that contains a
bunch of log files that independently may or may not exist, e.g.
"optional_logs" slist => { "auth", "cron", "daemon", "ftp", "kern",
... };
Then I'd have two files promises:
"/var/adm/$(optional_logs)"
...
"/var/adm/$(optional_logs).info"
...
Does that make it clearer or am I missing a way I might use the new
features you mentioned?
Thanks,
Justin
-----Original Message-----
From: Mark Burgess [mailto:[email protected]]
Sent: Thursday, May 13, 2010 11:23 AM
To: Justin Lloyd
Cc: [email protected]
Subject: Re: Optional files?
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
-------------------------------------------------
This electronic communication and any attachments may contain confidential and
proprietary
information of DigitalGlobe, Inc. If you are not the intended recipient, or an
agent or employee
responsible for delivering this communication to the intended recipient, or if
you have received
this communication in error, please do not print, copy, retransmit, disseminate
or
otherwise use the information. Please indicate to the sender that you have
received this
communication in error, and delete the copy you received. DigitalGlobe reserves
the
right to monitor any electronic communication sent or received by its
employees, agents
or representatives.
_______________________________________________
Help-cfengine mailing list
[email protected]
https://cfengine.org/mailman/listinfo/help-cfengine