help-cfengine
[Top][All Lists]
Advanced

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

RE: Copy+editfiles


From: Martin, Jason H
Subject: RE: Copy+editfiles
Date: Wed, 24 Aug 2005 09:34:58 -0700

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

-----Original Message-----
From: address@hidden
[mailto:address@hidden On
Behalf Of Atom Powers
Sent: Wednesday, August 24, 2005 9:23 AM
To: address@hidden
Subject: Re: Copy+editfiles


On 8/24/05, Jason Martin <address@hidden> 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
address@hidden
http://lists.gnu.org/mailman/listinfo/help-cfengine




reply via email to

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