Fix unstable package repository and network configuration.

This commit is contained in:
Tomasz Rybak 2014-01-09 21:25:22 +01:00
parent 4b9d801734
commit 3bc47f69f7
4 changed files with 23 additions and 11 deletions

View file

@ -25,8 +25,9 @@ class AddDefaultSources(Task):
def run(cls, info):
info.source_lists.add('main', 'deb {apt_mirror} {system.release} main')
info.source_lists.add('main', 'deb-src {apt_mirror} {system.release} main')
info.source_lists.add('main', 'deb {apt_mirror} {system.release}-updates main')
info.source_lists.add('main', 'deb-src {apt_mirror} {system.release}-updates main')
if info.manifest.system['release'] != 'unstable':
info.source_lists.add('main', 'deb {apt_mirror} {system.release}-updates main')
info.source_lists.add('main', 'deb-src {apt_mirror} {system.release}-updates main')
class InstallTrustedKeys(Task):

View file

@ -0,0 +1,13 @@
{
"squeeze": [
"auto lo\n",
"iface lo inet loopback\n",
"auto eth0\n",
"iface eth0 inet dhcp\n" ],
"wheezy": [
"auto eth0\n",
"iface eth0 inet dhcp\n" ],
"unstable": [
"auto eth0\n",
"iface eth0 inet dhcp\n" ]
}

View file

@ -30,11 +30,9 @@ class ConfigureNetworkIF(Task):
@classmethod
def run(cls, info):
interfaces_path = os.path.join(info.root, 'etc/network/interfaces')
if_config = {'squeeze': ('auto lo\n'
'iface lo inet loopback\n'
'auto eth0\n'
'iface eth0 inet dhcp\n'),
'wheezy': 'auto eth0\n'
'iface eth0 inet dhcp\n'}
if_config = []
with open('common/tasks/network-configuration.json') as stream:
import json
if_config = json.loads(stream.read())
with open(interfaces_path, 'a') as interfaces:
interfaces.write(if_config.get(info.manifest.system['release']))
interfaces.write(''.join(if_config.get(info.manifest.system['release'])))

View file

@ -19,8 +19,8 @@ class DefaultPackages(Task):
# In squeeze, we need a special kernel flavor for xen
kernels = {}
with open('packages-kernels.json') as stream:
with open('providers/ec2/tasks/packages-kernels.json') as stream:
import json
kernel = json.loads(stream.read())
kernels = json.loads(stream.read())
kernel_package = kernels.get(info.manifest.system['release']).get(info.manifest.system['architecture'])
info.packages.add(kernel_package)