[wplug] sed kung-fu and the art of kickstart file maintenance

terry mcintyre terrymcintyre at yahoo.com
Thu Mar 3 11:03:46 EST 2011


My sed-fu isn't strong enough to answer that directly, but cobbler does an 
excellent job of dynamically generating custom kickstart files for custom 
classes. 

One creates one or a few kickstart templates, including Python code snippets 
which handle the customization magic; they're extremely powerful. Cobbler, based 
upon the template(s) and short descriptions of particular systems, generates 
custom kickstart files for each server.

The %post section can include all sorts of sed-fu and so forth, combined with 
the ability to pull in information ( such as host name, IP address, yadda yadda 
) from the system description. 

https://fedorahosted.org/cobbler/


I'd be happy to consult with anyone who wishes to set up such a system.
Terry McIntyre <terrymcintyre at yahoo.com>


Unix/Linux Systems Administration
Taking time to do it right saves having to do it twice.



________________________________
From: Gabriel L. Somlo <gsomlo at gmail.com>
To: wplug at wplug.org
Sent: Thu, March 3, 2011 10:02:27 AM
Subject: [wplug] sed kung-fu and the art of kickstart file maintenance

Hi,

I maintain a bunch of kickstart files for a few classes of machines I
deal with. A frequent thing happening in the %post section is that
some config files get edited in a small way, by either appending or
modifying a few lines. I do that using here-documents and sed,
respectively.

Recently, I encountered a situation where I need to insert a few lines
into a config file at a *specific* location. I figured, in order to
stay consistent with my previous style, I'd use sed *and* here-documents
to do the job, but all I could come up was this:

sed -i 's/\[section_title\]/cat/e' /etc/configfile.conf <<EOT
[section_title]
foo
bar
blah
EOT

Is there a way to write something like this without the need to
repeat the string '[section_title'' in the here-document ? Something
more along the lines of the 'a' sed command instead of 's' ?

Or am I making this way too complicated ? :)

Thanks,
--Gabriel
_______________________________________________
wplug mailing list
wplug at wplug.org
http://www.wplug.org/mailman/listinfo/wplug



      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.wplug.org/pipermail/wplug/attachments/20110303/e6745b8b/attachment.html 


More information about the wplug mailing list