mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-24 07:26:29 +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 ebs
|
||||||
from tasks import filesystem
|
from tasks import filesystem
|
||||||
from tasks import bootstrap
|
from tasks import bootstrap
|
||||||
from tasks import config
|
from tasks import locale
|
||||||
from tasks import apt
|
from tasks import apt
|
||||||
|
|
||||||
|
|
||||||
|
@ -36,9 +36,9 @@ def tasks(tasklist, manifest):
|
||||||
tasklist.add(bootstrap.MakeTarball())
|
tasklist.add(bootstrap.MakeTarball())
|
||||||
tasklist.add(bootstrap.Bootstrap(),
|
tasklist.add(bootstrap.Bootstrap(),
|
||||||
filesystem.MountSpecials(),
|
filesystem.MountSpecials(),
|
||||||
config.GenerateLocale(),
|
locale.GenerateLocale(),
|
||||||
config.SetTimezone(),
|
locale.SetTimezone(),
|
||||||
config.AptSources(),
|
apt.AptSources(),
|
||||||
apt.AptUpgrade())
|
apt.AptUpgrade())
|
||||||
|
|
||||||
from common.tasks import TriggerRollback
|
from common.tasks import TriggerRollback
|
||||||
|
|
|
@ -2,7 +2,23 @@ from base import Task
|
||||||
from common import phases
|
from common import phases
|
||||||
from common.tools import log_check_call
|
from common.tools import log_check_call
|
||||||
import os
|
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):
|
class AptUpgrade(Task):
|
||||||
|
|
|
@ -33,20 +33,3 @@ class SetTimezone(Task):
|
||||||
zoneinfo_path = os.path.join(info.root, '/usr/share/zoneinfo', timezone)
|
zoneinfo_path = os.path.join(info.root, '/usr/share/zoneinfo', timezone)
|
||||||
localtime_path = os.path.join(info.root, 'etc/localtime')
|
localtime_path = os.path.join(info.root, 'etc/localtime')
|
||||||
copy(zoneinfo_path, localtime_path)
|
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