bootstrap-vz/bootstrapvz/providers/gce/__init__.py
Jimmy Kaplowitz 3bfe9dddf9 Reinstate hostname hook for GCE
This DHCP exit hook to shorten the system hostname on GCE was previously
installed by build-debian-cloud and bootstrap-vz, but seems to have been
inadvertently removed in commit c81045cc6e
as part of a broad cross-cloud cleanup. Again, this was caught by our
validation tests, and we might be done with the fixes at this point.

In this commit, I'm reinstating the hook with a name change and an
explanatory comment, to reduce the risk of this vanishing accidentally
in the future.

Change-Id: I4e7268f8b9ab3b2a7fc8b510898c6fbdd685aa53
2014-08-05 17:56:33 -07:00

57 lines
1.7 KiB
Python

from bootstrapvz.common import task_groups
import tasks.apt
import tasks.boot
import tasks.configuration
import tasks.image
import tasks.host
import tasks.packages
from bootstrapvz.common.tasks import apt
from bootstrapvz.common.tasks import loopback
from bootstrapvz.common.tasks import initd
from bootstrapvz.common.tasks import ssh
from bootstrapvz.common.tasks import volume
def initialize():
pass
def validate_manifest(data, validator, error):
import os.path
schema_path = os.path.normpath(os.path.join(os.path.dirname(__file__), 'manifest-schema.yml'))
validator(data, schema_path)
def resolve_tasks(taskset, manifest):
taskset.update(task_groups.get_standard_groups(manifest))
taskset.update([apt.AddBackports,
loopback.AddRequiredCommands,
loopback.Create,
tasks.apt.SetPackageRepositories,
tasks.apt.ImportGoogleKey,
tasks.packages.DefaultPackages,
tasks.packages.GooglePackages,
tasks.configuration.GatherReleaseInformation,
tasks.host.DisableIPv6,
tasks.host.InstallHostnameHook,
tasks.boot.ConfigureGrub,
initd.InstallInitScripts,
ssh.AddSSHKeyGeneration,
tasks.apt.CleanGoogleRepositoriesAndKeys,
loopback.MoveImage,
tasks.image.CreateTarball,
volume.Delete,
])
if 'gcs_destination' in manifest.image:
taskset.add(tasks.image.UploadImage)
if 'gce_project' in manifest.image:
taskset.add(tasks.image.RegisterImage)
def resolve_rollback_tasks(taskset, manifest, completed, counter_task):
taskset.update(task_groups.get_standard_rollback_tasks(completed))