def resolve_tasks(taskset, manifest):
	from bootstrapvz.common import task_sets
	taskset.update(task_sets.base_set)
	taskset.update(task_sets.volume_set)
	taskset.update(task_sets.mounting_set)
	taskset.update(task_sets.get_apt_set(manifest))
	taskset.update(task_sets.locale_set)

	taskset.update(task_sets.bootloader_set.get(manifest.system['bootloader']))

	if manifest.volume['partitions']['type'] != 'none':
		taskset.update(task_sets.partitioning_set)

	if manifest.system.get('hostname', False):
		taskset.add(network.SetHostname)
	else:
		taskset.add(network.RemoveHostname)

	taskset.update([tasks.packages.DefaultPackages,

	                loopback.Create,

	                security.EnableShadowConfig,
	                network.RemoveDNSInfo,
	                network.ConfigureNetworkIF,
	                initd.AddSSHKeyGeneration,
	                initd.InstallInitScripts,
	                cleanup.ClearMOTD,
	                cleanup.CleanTMP,

	                loopback.MoveImage,
	                ])

	if manifest.bootstrapper.get('guest_additions', False):
		from tasks import guest_additions
		taskset.update([guest_additions.CheckGuestAdditionsPath,
		                guest_additions.AddGuestAdditionsPackages,
		                guest_additions.InstallGuestAdditions,
		                ])

	if manifest.bootstrapper.get('tarball', False):
		taskset.add(bootstrap.MakeTarball)

	taskset.update(task_sets.get_fs_specific_set(manifest.volume['partitions']))

	if 'boot' in manifest.volume['partitions']:
		taskset.update(task_sets.boot_partition_set)
def resolve_tasks(taskset, manifest):
	from bootstrapvz.common import task_sets
	taskset.update(task_sets.base_set)
	taskset.update(task_sets.mounting_set)
	taskset.update(task_sets.get_apt_set(manifest))
	taskset.update(task_sets.locale_set)
	taskset.update(task_sets.ssh_set)

	if manifest.volume['partitions']['type'] != 'none':
		taskset.update(task_sets.partitioning_set)

	taskset.update([tasks.host.AddExternalCommands,
	                tasks.packages.DefaultPackages,
	                tasks.connection.GetCredentials,
	                tasks.host.GetInfo,
	                tasks.ami.AMIName,
	                tasks.connection.Connect,

	                boot.BlackListModules,
	                boot.DisableGetTTYs,
	                security.EnableShadowConfig,
	                network.RemoveDNSInfo,
	                network.RemoveHostname,
	                network.ConfigureNetworkIF,
	                tasks.network.EnableDHCPCDDNS,
	                initd.AddExpandRoot,
	                initd.AddSSHKeyGeneration,
	                initd.RemoveHWClock,
	                tasks.initd.AddEC2InitScripts,
	                initd.InstallInitScripts,
	                initd.AdjustExpandRootScript,
	                cleanup.ClearMOTD,
	                cleanup.CleanTMP,

	                tasks.ami.RegisterAMI,
	                ])

	if manifest.system['bootloader'] == 'pvgrub':
		taskset.add(boot.AddGrubPackage)
		taskset.add(tasks.boot.ConfigurePVGrub)
	else:
		taskset.update(task_sets.bootloader_set.get(manifest.system['bootloader']))

	backing_specific_tasks = {'ebs': [tasks.ebs.Create,
	                                  tasks.ebs.Attach,
	                                  filesystem.FStab,
	                                  tasks.ebs.Snapshot],
	                          's3': [loopback.AddRequiredCommands,
	                                 loopback.Create,
	                                 volume.Attach,
	                                 tasks.filesystem.S3FStab,
	                                 tasks.ami.BundleImage,
	                                 tasks.ami.UploadImage,
	                                 tasks.ami.RemoveBundle]}
	taskset.update(backing_specific_tasks.get(manifest.volume['backing'].lower()))
	taskset.update([filesystem.Format,
	                volume.Detach,
	                volume.Delete,
	                ])

	if manifest.bootstrapper.get('tarball', False):
		taskset.add(bootstrap.MakeTarball)

	taskset.update(task_sets.get_fs_specific_set(manifest.volume['partitions']))

	if 'boot' in manifest.volume['partitions']:
		taskset.update(task_sets.boot_partition_set)