bootstrap-vz/providers/one/tasks/packages.py

50 lines
1.5 KiB
Python
Raw Normal View History

2013-07-10 10:49:45 +02:00
from base import Task
from common import phases
class HostPackages(Task):
description = 'Determining required host packages'
phase = phases.preparation
def run(self, info):
2013-07-31 08:02:52 +02:00
packages = set(['debootstrap', 'qemu-utils', 'parted', 'grub2', 'sysv-rc'])
2013-07-10 10:49:45 +02:00
if info.manifest.volume['filesystem'] == 'xfs':
packages.add('xfsprogs')
info.host_packages = packages
class ImagePackages(Task):
description = 'Determining required image packages'
phase = phases.preparation
def run(self, info):
manifest = info.manifest
# Add some basic packages we are going to need
include = set(['udev',
'parted',
2013-07-10 10:49:45 +02:00
'openssh-server',
# We could bootstrap without locales, but things just suck without them, error messages etc.
'locales',
# Needed for the init scripts
'file',
# isc-dhcp-client doesn't work properly with ec2
'dhcpcd',
2013-07-10 14:55:27 +02:00
'grub2',
2013-07-31 08:02:52 +02:00
'chkconfig',
'openssh-client'
2013-07-10 10:49:45 +02:00
])
exclude = set(['isc-dhcp-client',
'isc-dhcp-common',
])
# In squeeze, we need a special kernel flavor for xen
kernels = {'squeeze': {'amd64': 'linux-image-amd64',
'i386': 'linux-image-686', },
2013-07-10 10:49:45 +02:00
'wheezy': {'amd64': 'linux-image-amd64',
'i386': 'linux-image-686', }, }
include.add(kernels.get(manifest.system['release']).get(manifest.system['architecture']))
info.img_packages = include, exclude