Will, what you are trying to do is not a convergent operation and I strongly 
advise
against it. (Merging 2 sets cannot be convergent because if the sets overlap, 
the outcome
is unclear).  Purging only adds to the confusion. It's like getting two teams 
to paint
your house and telling one "paint it red" and the other "paint it white" -- 
then "off you
go and let me now when your're done". There is no desired end state.

I would copy the files without purging and periodically delete everything if 
you want to
clean up. That is the only reliable way. I would also avoid trying to merge 
things unless
you know that files can never overlap.

Will Nowak wrote:
> i All,
> 
> I've been toying around with CFengine a bit, and have run into a bit
> of a wall. I've got a bunch of machines that all need a certain set of
> files copied to /usr/local/everyone. On some of the machines, there
> are other special files that go in /usr/local/everyone that lay on top
> of the generic set of files. What I currently do is run two copy
> actions -- once as a general rule that applies to all machines, and
> another for specific special machines. This is well and good,
> everything gets copied. However, if we enable purge on the overlay
> set, it deletes all the files from the base set each copy run. Most of
> the time all the files are there, but during a copy run, the base set
> briefly disappear.
> 
> Is there a way to do a copy operation and let CFengine know that it is
> a merge of two source directories?
> 
> # Base set of files
> copy:
>        any::
>                $(masterfiles)/everyone/        dest=/usr/local/everyone/
>                        server=$(policyhost)
>                        recurse=inf
>                        backup=false
> 
> # Special set of files
> classes:
>        isSpecial = (
>                special_hosts
>        )
> copy:
>        isSpecial::
>                $(masterfiles)/special_everyone/        
> dest=/usr/local/everyone/
>                                                        server=$(policyhost)
>                                                        backup=false
>                                                        purge=true
>                                                        recurse=inf
> 
> 
> Thanks!
> -Will
> _______________________________________________
> Help-cfengine mailing list
> Help-cfengine@cfengine.org
> https://cfengine.org/mailman/listinfo/help-cfengine

-- 
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