2013-09-22 20:46:25 +02:00
|
|
|
from common.tasks import workspace
|
|
|
|
from common.tasks import packages
|
|
|
|
from common.tasks import host
|
2013-10-09 00:09:34 +02:00
|
|
|
from common.tasks import bootstrap
|
2013-09-22 20:46:25 +02:00
|
|
|
from common.tasks import volume
|
|
|
|
from common.tasks import filesystem
|
|
|
|
from common.tasks import partitioning
|
|
|
|
from common.tasks import cleanup
|
|
|
|
from common.tasks import apt
|
|
|
|
from common.tasks import security
|
|
|
|
from common.tasks import locale
|
|
|
|
|
|
|
|
base_set = [workspace.CreateWorkspace,
|
2013-12-29 16:09:47 +01:00
|
|
|
host.HostDependencies,
|
|
|
|
host.CheckHostDependencies,
|
2013-10-09 00:09:34 +02:00
|
|
|
bootstrap.Bootstrap,
|
2013-09-22 20:46:25 +02:00
|
|
|
workspace.DeleteWorkspace,
|
|
|
|
]
|
|
|
|
|
|
|
|
volume_set = [volume.Attach,
|
|
|
|
volume.Detach,
|
2013-10-09 00:09:34 +02:00
|
|
|
filesystem.Format,
|
|
|
|
filesystem.FStab,
|
2013-09-22 20:46:25 +02:00
|
|
|
]
|
|
|
|
|
|
|
|
partitioning_set = [partitioning.PartitionVolume,
|
|
|
|
partitioning.MapPartitions,
|
|
|
|
partitioning.UnmapPartitions,
|
|
|
|
]
|
|
|
|
|
|
|
|
boot_partition_set = [filesystem.CreateBootMountDir,
|
|
|
|
filesystem.MountBoot,
|
|
|
|
]
|
|
|
|
|
|
|
|
mounting_set = [filesystem.CreateMountDir,
|
|
|
|
filesystem.MountRoot,
|
|
|
|
filesystem.MountSpecials,
|
|
|
|
filesystem.UnmountRoot,
|
|
|
|
filesystem.DeleteMountDir,
|
|
|
|
]
|
|
|
|
|
|
|
|
ssh_set = [security.DisableSSHPasswordAuthentication,
|
|
|
|
security.DisableSSHDNSLookup,
|
|
|
|
cleanup.ShredHostkeys,
|
|
|
|
]
|
|
|
|
|
2013-12-29 18:11:48 +01:00
|
|
|
apt_set = [apt.AddDefaultSources,
|
|
|
|
apt.WriteSources,
|
2013-12-29 16:09:47 +01:00
|
|
|
apt.DisableDaemonAutostart,
|
2013-11-30 22:37:51 +01:00
|
|
|
apt.AptUpdate,
|
2013-09-22 20:46:25 +02:00
|
|
|
apt.AptUpgrade,
|
2013-12-29 16:09:47 +01:00
|
|
|
packages.InstallRemotePackages,
|
|
|
|
packages.InstallLocalPackages,
|
2013-09-22 20:46:25 +02:00
|
|
|
apt.PurgeUnusedPackages,
|
|
|
|
apt.AptClean,
|
|
|
|
apt.EnableDaemonAutostart,
|
|
|
|
]
|
|
|
|
|
2013-12-29 16:09:47 +01:00
|
|
|
locale_set = [locale.LocaleBootstrapPackage,
|
|
|
|
locale.GenerateLocale,
|
2013-09-22 20:46:25 +02:00
|
|
|
locale.SetTimezone,
|
|
|
|
]
|
|
|
|
|
2013-10-06 01:42:32 +02:00
|
|
|
|
|
|
|
def get_fs_specific_set(partitions):
|
|
|
|
task_set = {'ext2': [filesystem.TuneVolumeFS],
|
|
|
|
'ext3': [filesystem.TuneVolumeFS],
|
|
|
|
'ext4': [filesystem.TuneVolumeFS],
|
|
|
|
'xfs': [filesystem.AddXFSProgs],
|
|
|
|
}
|
|
|
|
tasks = set()
|
|
|
|
if 'boot' in partitions:
|
|
|
|
tasks.update(task_set.get(partitions['boot']['filesystem'], []))
|
|
|
|
if 'root' in partitions:
|
|
|
|
tasks.update(task_set.get(partitions['root']['filesystem'], []))
|
|
|
|
return tasks
|