summaryrefslogtreecommitdiffstats
path: root/cobbler/item_profile.py
diff options
context:
space:
mode:
authorMichael DeHaan <mdehaan@redhat.com>2006-07-12 17:00:49 -0400
committerJim Meyering <jim@meyering.net>2006-07-12 17:00:49 -0400
commitbea30de4beb585b5c79d10c6164e65713f1611bc (patch)
tree435799b37baa464c21e42e622914cbdd8b33276f /cobbler/item_profile.py
parentf061199e4f8a3ea0e769325e72029ca7d791b206 (diff)
downloadthird_party-cobbler-bea30de4beb585b5c79d10c6164e65713f1611bc.tar.gz
third_party-cobbler-bea30de4beb585b5c79d10c6164e65713f1611bc.tar.xz
third_party-cobbler-bea30de4beb585b5c79d10c6164e65713f1611bc.zip
Added templating support through new --ks_meta option which works like --kopts. The parameter is a space delimited list of key=value pairs, which allows the variables entered to be evaluated through Cheetah. Thus kickstarts are now Cheetah templates. All templating errors are ignored so usage of a $ in a template is still legal where it doesn't reference a variable. Error ignoring should be finer grained and this does need some tests. Currently this only works for kickstarts on filesystems, and I'm not sure what the behavior for http and nfs should be. Anyhow, fairly useful stuff.
Diffstat (limited to 'cobbler/item_profile.py')
-rw-r--r--cobbler/item_profile.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/cobbler/item_profile.py b/cobbler/item_profile.py
index 46c7929..e3cecfe 100644
--- a/cobbler/item_profile.py
+++ b/cobbler/item_profile.py
@@ -33,11 +33,12 @@ class Profile(item.Item):
self.distro = None # a name, not a reference
self.kickstart = None
self.kernel_options = ''
+ self.ks_meta = ''
self.xen_name = 'xenguest'
- self.xen_file_size = 5 # GB
- self.xen_ram = 2048 # MB
- self.xen_mac = ''
- self.xen_paravirt = True
+ self.xen_file_size = 5 # GB. 5 = Decent _minimum_ default for FC5.
+ self.xen_ram = 512 # MB. Install with 256 not likely to pass
+ self.xen_mac = '' # allow random generation as default
+ self.xen_paravirt = True # hvm support is *NOT* in Koan (now)
def from_datastruct(self,seed_data):
"""
@@ -47,6 +48,7 @@ class Profile(item.Item):
self.distro = seed_data['distro']
self.kickstart = seed_data['kickstart']
self.kernel_options = seed_data['kernel_options']
+ self.ks_meta = seed_data['ks_meta']
self.xen_name = seed_data['xen_name']
if not self.xen_name or self.xen_name == '':
self.xen_name = self.name
@@ -176,7 +178,8 @@ class Profile(item.Item):
'xen_file_size' : self.xen_file_size,
'xen_ram' : self.xen_ram,
'xen_mac' : self.xen_mac,
- 'xen_paravirt' : self.xen_paravirt
+ 'xen_paravirt' : self.xen_paravirt,
+ 'ks_meta' : self.ks_meta
}
def printable(self,id):
@@ -187,6 +190,7 @@ class Profile(item.Item):
buf = buf + "distro : %s\n" % self.distro
buf = buf + "kickstart : %s\n" % self.kickstart
buf = buf + "kernel options : %s\n" % self.kernel_options
+ buf = buf + "ks metadata : %s\n" % self.ks_meta
buf = buf + "xen name : %s\n" % self.xen_name
buf = buf + "xen file size : %s\n" % self.xen_file_size
buf = buf + "xen ram : %s\n" % self.xen_ram