[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: autodefining classes of copied files
From: |
Mark Burgess |
Subject: |
Re: autodefining classes of copied files |
Date: |
Fri, 17 Feb 2006 20:25:14 +0100 |
Dalibor - I have looked at this now and I think this feature is
something to deal with in cfengine 3. I don't want to include the patch
in cfengine 2 at this time as the additional memory requirement could
jeopardize the stability of cfagent,
cheers
Mark
On Thu, 2006-02-09 at 16:07 +0100, Dalibor Topic wrote:
> Brian C. Hill wrote:
>
> > Hi Dalibor,
> >
> > You can do this with AutoDefine (though I am having trouble
> >getting it work at the moment), but it still involves a little more
> >verbosity. You don't need to have individual copy statements w/ defines
> >for each file, but you do need a separate AutoDefine statement for each
> >one. It is am improvement, but it still makes a configuration look a
> >little busy.
> >
> >
> OK. I've looked at the code a bit, and it seems like it could be
> possible to do the following:
>
> In file image.c in function ImageCopy after the
>
>
> for (ptr = VAUTODEFINE; ptr != NULL; ptr=ptr->next)
> {
> if (strncmp(ptr->name,destfile,strlen(destfile)+1) == 0)
> {
> snprintf(OUTPUT,CF_BUFSIZE*2,"cfengine: image %s was set
> to autodefine %s\n",ptr->name,ptr->classes);
> CfLog(cfinform,OUTPUT,"");
> AddMultipleClasses(ptr->classes);
> }
> }
>
> block, one could add calls for AddMultipleClasses("copied_"+sourcefile)
> and/or "copied_+destfile", afaict, and have copied_* classes
> automatically defined for files that were successfully copied. That
> should allow one to do away with AutoDefines, right? Does that sound
> useful & correct?
> I haven't hacked on cfengine before, so I am just finding my ways around
> the source.
>
> The other issue I'd be interested in would to see if there is a way to
> use regular expressions in classes, such that I can write a rule for all
> copied *.tar.gz files, for example. Is it possible already to write
> something like copied_*.tar.gz :: ? If not, how would one go about
> implementing something like IfCopied(*.tar.gz)?
>
> cheers,
> dalibor topic
>
>
> _______________________________________________
> Help-cfengine mailing list
> Help-cfengine@gnu.org
> http://lists.gnu.org/mailman/listinfo/help-cfengine