mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-24 07:26:29 +00:00
apt sources implemented
This commit is contained in:
parent
f0e3d45e21
commit
4157eefc3c
2 changed files with 18 additions and 0 deletions
|
@ -32,6 +32,7 @@ def tasks(tasklist, manifest):
|
||||||
tasklist.add(filesystem.MountSpecials())
|
tasklist.add(filesystem.MountSpecials())
|
||||||
tasklist.add(config.GenerateLocale())
|
tasklist.add(config.GenerateLocale())
|
||||||
tasklist.add(config.SetTimezone())
|
tasklist.add(config.SetTimezone())
|
||||||
|
tasklist.add(config.AptSources())
|
||||||
|
|
||||||
from common.tasks import TriggerRollback
|
from common.tasks import TriggerRollback
|
||||||
tasklist.add(TriggerRollback())
|
tasklist.add(TriggerRollback())
|
||||||
|
|
|
@ -33,3 +33,20 @@ 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