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

49 lines
1.5 KiB
Python
Raw Normal View History

2013-06-09 16:25:59 +02:00
from base import Task
2013-05-02 19:13:35 +02:00
class HostPackages(Task):
def run(self, info):
super(HostPackages, self).run(info)
packages = set(['debootstrap',
# To make sure a volume is not busy before unmounting we need lsof
'lsof',
])
2013-05-16 08:00:28 +02:00
if info.manifest.volume['filesystem'] == 'xfs':
2013-05-02 19:13:35 +02:00
packages.add('xfsprogs')
2013-05-16 08:00:28 +02:00
info.host_packages = packages
2013-05-02 19:13:35 +02:00
class ImagePackages(Task):
def run(self, info):
super(ImagePackages, self).run(info)
2013-05-16 08:00:28 +02:00
manifest = info.manifest
2013-05-02 19:13:35 +02:00
# Add some basic packages we are going to need
include = set(['udev',
'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',
])
if manifest.virtualization == 'pvm':
include.add('grub-pc')
exclude = set(['isc-dhcp-client',
'isc-dhcp-common',
])
# In squeeze, we need a special kernel flavor for xen
kernels = {'squeeze': {'amd64': 'linux-image-xen-amd64',
'i386': 'linux-image-xen-686', },
'wheezy': {'amd64': 'linux-image-amd64',
'i386': 'linux-image-686', }, }
include.add(kernels.get(manifest.system['release']).get(manifest.system['architecture']))
include = include.union(manifest.system['packages'])
2013-05-16 08:00:28 +02:00
info.img_packages = include, exclude