mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-22 09:50:37 +00:00
Implemented apt-upgrade
This commit is contained in:
parent
435084983d
commit
fd4a08c8b5
2 changed files with 27 additions and 1 deletions
|
@ -7,6 +7,7 @@ from tasks import ebs
|
|||
from tasks import filesystem
|
||||
from tasks import bootstrap
|
||||
from tasks import config
|
||||
from tasks import apt
|
||||
|
||||
|
||||
def initialize():
|
||||
|
@ -37,7 +38,8 @@ def tasks(tasklist, manifest):
|
|||
filesystem.MountSpecials(),
|
||||
config.GenerateLocale(),
|
||||
config.SetTimezone(),
|
||||
config.AptSources())
|
||||
config.AptSources(),
|
||||
apt.AptUpgrade())
|
||||
|
||||
from common.tasks import TriggerRollback
|
||||
tasklist.add(TriggerRollback())
|
||||
|
|
24
providers/ec2/tasks/apt.py
Normal file
24
providers/ec2/tasks/apt.py
Normal file
|
@ -0,0 +1,24 @@
|
|||
from base import Task
|
||||
from common import phases
|
||||
from common.tools import log_check_call
|
||||
import os
|
||||
from config import AptSources
|
||||
|
||||
|
||||
class AptUpgrade(Task):
|
||||
description = 'Upgrading packages and fixing broken dependencies'
|
||||
phase = phases.system_modification
|
||||
after = [AptSources]
|
||||
|
||||
def run(self, info):
|
||||
rc_policy_path = os.path.join(info.root, 'usr/sbin/policy-rc.d')
|
||||
with open(rc_policy_path, 'w') as rc_policy:
|
||||
rc_policy.write('#!/bin/sh\nexit 101')
|
||||
import stat
|
||||
os.chmod(rc_policy_path,
|
||||
stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR |
|
||||
stat.S_IRGRP | stat.S_IXGRP |
|
||||
stat.S_IROTH | stat.S_IXOTH)
|
||||
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'])
|
Loading…
Add table
Reference in a new issue