Customizing templates [message #22903] |
Wed, 07 November 2007 09:33  |
tauren
Messages: 7 Registered: November 2007
|
Junior Member |
|
|
I'm a newbie here and am slightly confused with building custom templates. I've been reading the wiki, manual, and forum all day but haven't found the answers I seek. Maybe I missed them, or maybe I'm not understanding something fundamental, but I could use help.
I have created a FC6 HN and would like to install multiple identical FC6 VEs into it. I've already got fedora-core-6-i386-minimal and fedora-core-6-i386-default up and running.
However, what I really want is an easy way to create custom VEs without having to manually customize it each time I create one. I need to add several packages to each VE I create. I also need to make several customizations to configuration files for every VE.
I can add packages by going into the VE and running "yum install whatever". Or I could use vzyum from the HN. I can edit the config files within the VE. But once I've created a "custom" VE, how do I then take that VE and turn it into a template? It seems like this would be a very common request, but the solution eludes me.
I've discovered that I can customize the RPM list that is in a template. I copied minimal.list to custom.list and then added several rpms to it. Then I ran vzpkgcache on it.
[root@pyrite /]# cd /vz/template/fedora-core/6/i386/config
[root@pyrite config]# cp minimal.list custom.list
[root@pyrite config]# vi custom.list
[root@pyrite config]# vzpkgcache fedora-core-6-custom
Is that the best way to customize the RPMs that are included in a template? It seems like a good solution, but is this the recommended way?
But then what about the configuration changes I want to make? Is the best solution to edit install-post, install-pre, and update-post with commands to make the appropriate edits? What if I only want those edits for the custom template, not minimal or default?
And making the scripts to do all those edits could be time consuming. Is there a simpler way to just create a VE, manually make the edits, and then use that VE to create a template? But I do want a template that can be updated. This is what I'm trying to figure out.
Thanks!
Tauren
|
|
|
|
Re: Customizing templates [message #22940 is a reply to message #22925] |
Wed, 07 November 2007 17:55   |
tauren
Messages: 7 Registered: November 2007
|
Junior Member |
|
|
alticon-brian wrote on Wed, 07 November 2007 10:09 | Tauren,
I know that the way that you're mentioning is exactly how we do it.
Specifically, we have a few custom templates that include things like Plesk pre-configured to work inside of a VPS so we can speed up deployment.
That being said, you'll possibly be able to streamline down your configuration editing by throwing some sed magic into your install-post, just a thought.
--Brian
|
Thanks Brian, it helps to have this confirmed. So, to clarify, the following method is the suggested way to customize templates:
1. Edit minimal.list, default.list, or create your own custom.list file in a template's config directory. Add all of the desired packages into that file.
2. Modify the install-post script with the appropriate commands to perform any customizations/configurations necessary in the system. As Brian suggests, sed is your friend.
3. Build the template with vzpkgcache.
Can some others confirm that this is the preferred/best way to accomplish what I would like to do. I'd like to add this information to the wiki because I think it would help others. But if there are other ways to do it, I'd like to include that information in the wiki as well.
Lastly, does anyone know if there is a way to make parts of install-post exclusive to a certain install type? For instance, only apply certain commands if custom.list was used? I suppose I could test for the install of certain RPMs (rpm -q) before issuing the sed commands.
Thanks again,
Tauren
|
|
|
|
|
|