help-cfengine
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: define based on multiple copies


From: Russell Adams
Subject: Re: define based on multiple copies
Date: Wed, 19 Nov 2003 18:17:10 -0600
User-agent: Mutt/1.4i

What you ought to look at is using subactionsequences (sp?).

ie:

control:
        actionsequence = ( directories
                           files
                           copy
                           shellcommands.BounceService
                           tidy )

copy:

        $(master)/conf.default  dest=/tmp/conf.default
                define=ServiceNeedsBounce
                type=checksum

        $(master)/conf.special  dest=/tmp/conf.special
                define=ServiceNeedsBounce
                type=checksum


shellcommands:

        BounceService.ServiceNeedsBounce::

                "/etc/init.d/service restart"

That'll allow you to use shellcommands elsewhere for other tasks, and
call the restart part when its needed, once.

Russell

On Tue, Nov 18, 2003 at 07:50:48PM -0600, Kurt Lieber wrote:
> _______________________________________________
> Help-cfengine mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/help-cfengine
> 

> Date: Tue, 18 Nov 2003 19:57:00 -0600
> Subject: 
> 
> 

> I have a series of configuration files that need to be copied from our
> master server to each client. Then, these files are assembled on the client
> machine and installed into the correct location.  (this is an /etc file for
> a particular service)
> 
> If any one file changes, I want to bounce that service.  However, if two or
> more files change, I don't want to bounce the service each time.  Right
> now, I have something similar to:
> 
> copy: 
> 
>       $(master)/conf.default  dest=/tmp/conf.default
>                               define=bounce_service
>                                                       type=checksum
> 
>       $(master)/conf.special  dest=/tmp/conf.special
>                               define=bounce_service
>                                                       type=checksum
> 
> 
> Then I use bounce_service in shellcommands: to assemble the two files and
> dump them into /etc/.  As you can see, that will restart the service twice,
> which is undesirable.
> 
> Can I achieve the same thing and only bounce the service once?
> 
> --kurt






reply via email to

[Prev in Thread] Current Thread [Next in Thread]