Add U10 JEOS support to heat jeos_create

This requires oz 0.9.0 (or latest master).  0.8.0 shipped with
most distros does not have customization support for Ubuntu
images.

fixes issue #23

Change-Id: I854aaf9657353b3fdb4768a277b527304e88ac8e
Signed-off-by: Steven Dake <sdake@redhat.com>
This commit is contained in:
Steven Dake 2012-05-23 16:09:00 -07:00
parent 03ae5b2d1c
commit 0cdccbd93f
3 changed files with 31 additions and 1 deletions

View File

@ -15,6 +15,7 @@ include heat/jeos/F16-x86_64-gold-jeos.tdl
include heat/jeos/F17-x86_64-gold-jeos.tdl
include heat/jeos/F16-x86_64-cfntools-jeos.tdl
include heat/jeos/F17-x86_64-cfntools-jeos.tdl
include heat/jeos/U10-amd64-cfntools-jeos.tdl
include heat/cfntools/cfn-init
include heat/cfntools/cfn-hup
include heat/cfntools/cfn-signal

View File

@ -0,0 +1,24 @@
<template>
<name>U10-x86_64-cfntools-jeos</name>
<os>
<name>Ubuntu</name>
<version>10.04</version>
<arch>x86_64</arch>
<install type='iso'>
<iso>file:/var/lib/libvirt/images/ubuntu-10.04.3-server-amd64.iso</iso>
</install>
</os>
<description>Ubuntu 10.04</description>
<commands>
<command name='commands'>
apt-get -y upgrade;apt-get -y install cloud-init;/usr/sbin/useradd ec2-user;echo -e 'ec2-user\tALL=(ALL)\tNOPASSWD: ALL' >> /etc/sudoers;chmod +x /opt/aws/bin/cfn-*
</command>
</commands>
<files>
<file name='/opt/aws/bin/cfn-init' type='base64'></file>
<file name='/opt/aws/bin/cfn-hup' type='base64'></file>
<file name='/opt/aws/bin/cfn-signal' type='base64'></file>
<file name='/opt/aws/bin/cfn_helper.py' type='base64'></file>
<file name='/opt/aws/bin/cfn-get-metadata' type='base64'></file>
</files>
</template>

View File

@ -112,11 +112,16 @@ def jeos_create(options, arguments, jeos_path, cfntools_path):
(distro, arch, instances_str))
sys.exit(1)
src_arch = 'i386'
fedora_match = re.match('F(1[6-7])', distro)
if fedora_match:
if arch == 'x86_64':
src_arch = 'x86_64'
version = fedora_match.group(1)
iso = '%s/Fedora-%s-%s-DVD.iso' % (images_dir, version, arch)
elif distro == 'U10':
if arch == 'amd64':
src_arch = 'x86_64'
iso = '%s/ubuntu-10.04.3-server-%s.iso' % (images_dir, arch)
else:
logging.error('distro %s not supported' % distro)
@ -149,7 +154,7 @@ def jeos_create(options, arguments, jeos_path, cfntools_path):
tdl_path = '/tmp/tdl'
dsk_filename = '%s/%s-%s-%s-jeos.dsk' % (images_dir, distro,
arch, instance_type)
src_arch, instance_type)
qcow2_filename = '%s/%s-%s-%s-jeos.qcow2' % (images_dir, distro,
arch, instance_type)
image_name = '%s-%s-%s' % (distro, arch, instance_type)