diff --git a/providers/ec2/__init__.py b/providers/ec2/__init__.py index 9d1f598..b824363 100644 --- a/providers/ec2/__init__.py +++ b/providers/ec2/__init__.py @@ -42,6 +42,7 @@ def tasks(tasklist, manifest): filesystem.MountSpecials(), locale.GenerateLocale(), locale.SetTimezone(), + apt.DisableDaemonAutostart(), apt.AptSources(), apt.AptUpgrade(), boot.ConfigureGrub(), diff --git a/providers/ec2/tasks/apt.py b/providers/ec2/tasks/apt.py index 3da13c5..209847e 100644 --- a/providers/ec2/tasks/apt.py +++ b/providers/ec2/tasks/apt.py @@ -22,10 +22,9 @@ class AptSources(Task): release=info.manifest.system['release']))) -class AptUpgrade(Task): - description = 'Upgrading packages and fixing broken dependencies' +class DisableDaemonAutostart(Task): + description = 'Disabling daemon autostart' phase = phases.system_modification - after = [GenerateLocale, AptSources] def run(self, info): rc_policy_path = os.path.join(info.root, 'usr/sbin/policy-rc.d') @@ -37,6 +36,14 @@ class AptUpgrade(Task): stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR | stat.S_IRGRP | stat.S_IXGRP | stat.S_IROTH | stat.S_IXOTH) + + +class AptUpgrade(Task): + description = 'Upgrading packages and fixing broken dependencies' + phase = phases.system_modification + after = [GenerateLocale, AptSources, DisableDaemonAutostart] + + def run(self, info): log_check_call(['chroot', info.root, 'apt-get', 'update']) log_check_call(['chroot', info.root, 'apt-get', '-f', '-y', 'install']) log_check_call(['chroot', info.root, 'apt-get', '-y', 'upgrade'])