mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-22 09:50:37 +00:00
Move AptSources into apt module
This commit is contained in:
parent
fd4a08c8b5
commit
6628429732
3 changed files with 21 additions and 22 deletions
|
@ -6,7 +6,7 @@ from tasks import host
|
|||
from tasks import ebs
|
||||
from tasks import filesystem
|
||||
from tasks import bootstrap
|
||||
from tasks import config
|
||||
from tasks import locale
|
||||
from tasks import apt
|
||||
|
||||
|
||||
|
@ -36,9 +36,9 @@ def tasks(tasklist, manifest):
|
|||
tasklist.add(bootstrap.MakeTarball())
|
||||
tasklist.add(bootstrap.Bootstrap(),
|
||||
filesystem.MountSpecials(),
|
||||
config.GenerateLocale(),
|
||||
config.SetTimezone(),
|
||||
config.AptSources(),
|
||||
locale.GenerateLocale(),
|
||||
locale.SetTimezone(),
|
||||
apt.AptSources(),
|
||||
apt.AptUpgrade())
|
||||
|
||||
from common.tasks import TriggerRollback
|
||||
|
|
|
@ -2,7 +2,23 @@ from base import Task
|
|||
from common import phases
|
||||
from common.tools import log_check_call
|
||||
import os
|
||||
from config import AptSources
|
||||
|
||||
|
||||
class AptSources(Task):
|
||||
description = 'Adding aptitude sources'
|
||||
phase = phases.system_modification
|
||||
|
||||
def run(self, info):
|
||||
sources_path = os.path.join(info.root, 'etc/apt/sources.list')
|
||||
with open(sources_path, 'w') as apt_sources:
|
||||
apt_sources.write(('deb {apt_mirror} {release} main\n'
|
||||
'deb-src {apt_mirror} {release} main\n'.
|
||||
format(apt_mirror='http://http.debian.net/debian',
|
||||
release=info.manifest.system['release'])))
|
||||
apt_sources.write(('deb {apt_mirror} {release}/updates main\n'
|
||||
'deb-src {apt_mirror} {release}/updates main\n'.
|
||||
format(apt_mirror='http://security.debian.org/',
|
||||
release=info.manifest.system['release'])))
|
||||
|
||||
|
||||
class AptUpgrade(Task):
|
||||
|
|
|
@ -33,20 +33,3 @@ class SetTimezone(Task):
|
|||
zoneinfo_path = os.path.join(info.root, '/usr/share/zoneinfo', timezone)
|
||||
localtime_path = os.path.join(info.root, 'etc/localtime')
|
||||
copy(zoneinfo_path, localtime_path)
|
||||
|
||||
|
||||
class AptSources(Task):
|
||||
description = 'Adding aptitude sources'
|
||||
phase = phases.system_modification
|
||||
|
||||
def run(self, info):
|
||||
sources_path = os.path.join(info.root, 'etc/apt/sources.list')
|
||||
with open(sources_path, 'w') as apt_sources:
|
||||
apt_sources.write(('deb {apt_mirror} {release} main\n'
|
||||
'deb-src {apt_mirror} {release} main\n'.
|
||||
format(apt_mirror='http://http.debian.net/debian',
|
||||
release=info.manifest.system['release'])))
|
||||
apt_sources.write(('deb {apt_mirror} {release}/updates main\n'
|
||||
'deb-src {apt_mirror} {release}/updates main\n'.
|
||||
format(apt_mirror='http://security.debian.org/',
|
||||
release=info.manifest.system['release'])))
|
Loading…
Add table
Reference in a new issue