[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: editfiles: adding/updating config file sections
From: |
Paul Heinlein |
Subject: |
Re: editfiles: adding/updating config file sections |
Date: |
Mon, 21 Oct 2002 11:51:33 -0700 (PDT) |
On Sat, 19 Oct 2002, Kai Großjohann wrote:
> We have a lot of verses like the following in our cfengine 1.6
> configuration:
>
> # Frob IDE parameters for speed.
> { /etc/init.d/hwtools
> AppendIfNoSuchLine "# begin i06"
> AppendIfNoSuchLine "# end i06"
> LocateLineMatching "# begin i06"
> DeleteToLineMatching "# end i06"
> DeleteLinesMatching "# end i06"
> AppendIfNoSuchLine "# begin i06"
> AppendIfNoSuchLine "# end i06"
> ResetSearch "1"
> LocateLineMatching "# begin i06"
> InsertFile "$(cfedir)/files/_etc_init.d_hwtools.template"
> }
I think I'd do something a bit different:
copy:
linux.whatever::
$(cfedir)/files/_etc_init.d_hwtools.template
dest=/etc/init.d/hwtools.local m=444 o=0 g=0 type=sum
editfiles:
linux.whatever::
{ /etc/init.d/hwtools
BeginGroupIfNoSuchLine "source /etc/init.d/hwtools.local"
DeleteLinesContaining "/etc/init.d/hwtools.local"
Append "source /etc/init.d/hwtools.local"
EndGroup
}
--Paul Heinlein <heinlein@cse.ogi.edu>