[prev in list] [next in list] [prev in thread] [next in thread]
List: cfengine-help
Subject: RE: Copy+editfiles
From: "Martin, Jason H" <jason.h.martin () cingular ! com>
Date: 2005-08-24 16:49:23
Message-ID: 7208F00F752DCB4DBDA78CFAEFAA078C0462A228 () WA-MSG08-BTH ! wireless ! attws ! com
[Download RAW message or body]
Perfect! Thank you.
-Jason Martin
-----Original Message-----
From: Atom Powers [mailto:atom.powers@gmail.com]
Sent: Wednesday, August 24, 2005 9:46 AM
To: Martin, Jason H
Cc: help-cfengine@gnu.org
Subject: Re: Copy+editfiles
On 8/24/05, Martin, Jason H <jason.h.martin@cingular.com> wrote:
> In that situation, if someone removes / changes a line from
> /usr/local/etc/smb.conf that originated from
> /var/cfengine/work/smb.conf, will cfe rebuild /usr/local/etc/smb.conf?
> If so, this is the solution I was looking for, as it guarantees the
> integrity of /usr/local/etc/smb.conf without making unnecessary
> changes to it.
>
> Thank you,
> -Jason Martin
>
Yes. That method guarantees the integrity of smb.conf to match the
"source" copy at "$(FileSource)/common/usr/local/etc/smb.conf" no matter
what was done to the local /usr/local/etc/smb.conf. Even if it was
deleted, changed, etc. I believe cfengine also checks the "new" version
against the "current" version and only makes changes if they differ.
> -----Original Message-----
> From: help-cfengine-bounces+jason.h.martin=cingular.com@gnu.org
> [mailto:help-cfengine-bounces+jason.h.martin=cingular.com@gnu.org] On
> Behalf Of Atom Powers
> Sent: Wednesday, August 24, 2005 9:23 AM
> To: help-cfengine@gnu.org
> Subject: Re: Copy+editfiles
>
>
> On 8/24/05, Jason Martin <jhmartin@toger.us> wrote:
> > I've got a 500 line file that should be the same on all my hosts,
> > save
>
> > that one of the lines need to be customized to the hostname. Does
> > anyone have any tips on how to do this? I'd rather not enter a
> > 500-line editfiles stanza if possible. Is there any way to do a
> > copy+editfiles action?
> >
> > Thank you,
> > -Jason Martin
>
> Here's how I solved that problem when I was working with smb.conf.
> Obviously the copy action is before the editfiles action. And this
> method may not work if you need your edits to be nested or in a
> specific order.
>
> copy:
> any::
> # Samba configuration
> $(FileSource)/common/usr/local/etc/smb.conf
> dest=/var/cfengine/work/smb.conf
> server=$(FileServer)
>
> editfiles:
> any::
> {
> /usr/local/etc/smb.conf
> AutoCreate
> EmptyEntireFilePlease
> InsertLine "hostname = $(host)"
> InsertFile "/var/cfengine/work/smb.conf"
> DefineClasses "newsamba"
> }
>
>
> _______________________________________________
> Help-cfengine mailing list
> Help-cfengine@gnu.org
> http://lists.gnu.org/mailman/listinfo/help-cfengine
>
--
--
Perfection is just a word I use occasionally with mustard. --Atom
Powers--
_______________________________________________
Help-cfengine mailing list
Help-cfengine@gnu.org
http://lists.gnu.org/mailman/listinfo/help-cfengine
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic