help-cfengine
[Top][All Lists]
Advanced

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

Re: DefineClasses help


From: Andrew Stribblehill
Subject: Re: DefineClasses help
Date: Tue, 25 Feb 2003 14:14:27 +0000
User-agent: Mutt/1.5.3i

Quoting Zeev Fisher <zeevf@il.marvell.com> (2003-02-25 01:16:26 GMT):
> I have the following in my editfiles section :
> 
>        { /etc/sysconfig/network
> 
>                BeginGroupIfNoSuchLine "NISDOMAIN=$(domain)"
>                        DeleteLinesMatching "^NISDOMAIN.*"
>                        Append "NISDOMAIN=$(domain)"
>                EndGroup
>                DefineClasses "RestartNis"
>                BeginGroupIfNoSuchLine "GATEWAY=$(defaultrouter)"
>                        DeleteLinesMatching "^GATEWAY.*"
>                        Append "GATEWAY=$(defaultrouter)"
>                EndGroup
>        }

Yes, that makes sense. The info pages state:

`DefineClasses "CLASS1:CLASS2:..."'
     Activate the following colon, comma or dot-separated list of
     classes if and only if the file is edited.

> The class " RestartNis" starts not only if i something changed in the 
> NISDOMAIN but either if the GATEWAY changes. The same thing happened if 
> i split it like that :
> 
> { /etc/sysconfig/network
> 
>                BeginGroupIfNoSuchLine "NISDOMAIN=$(domain)"
>                        DeleteLinesMatching "^NISDOMAIN.*"
>                        Append "NISDOMAIN=$(domain)"
>                EndGroup
>                DefineClasses "RestartNis"
> }
> { /etc/sysconfig/network
> 
>                BeginGroupIfNoSuchLine "GATEWAY=$(defaultrouter)"
>                        DeleteLinesMatching "^GATEWAY.*"
>                        Append "GATEWAY=$(defaultrouter)"
>                EndGroup
> }

Cool, I didn't know that worked. It does exactly what the docs said
it would do. Namely define RestartNis if the file was edited by
Cfengine.

-- 
VIKING NORTH UTSIRE SOUTH UTSIRE FORTIES CROMARTY FORTH
SOUTHEAST 5 OR 6, OCCASIONALLY 7 LATER. DRIZZLE AT TIMES. MODERATE
WITH FOG BANKS, BECOMING GOOD AT TIMES LATER




reply via email to

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