From 99ae9988ff35b6699fdfa62fe03d4135eaea80fc Mon Sep 17 00:00:00 2001 From: Tomasz Rybak Date: Sat, 25 Jan 2014 15:52:58 +0100 Subject: [PATCH 1/3] Add testing distribution and ability to use non-main sections. --- base/manifest-schema.json | 3 +- common/tasks/apt.py | 13 +++--- ...n-unstable-contrib-amd64-pvm.manifest.json | 45 +++++++++++++++++++ 3 files changed, 55 insertions(+), 6 deletions(-) create mode 100644 manifests/ec2-ebs-debian-unstable-contrib-amd64-pvm.manifest.json diff --git a/base/manifest-schema.json b/base/manifest-schema.json index 30e16c2..5ecf1da 100644 --- a/base/manifest-schema.json +++ b/base/manifest-schema.json @@ -25,7 +25,8 @@ "system": { "type": "object", "properties": { - "release": { "enum": ["wheezy", "unstable"] }, + "release": { "enum": ["wheezy", "testing", "unstable"] }, + "sections": { "type": "array" }, "architecture": { "enum": ["i386", "amd64"] }, "bootloader": { "enum": ["pvgrub", "grub", "extlinux"] }, "timezone": { "type": "string" }, diff --git a/common/tasks/apt.py b/common/tasks/apt.py index e925c5d..5dc3446 100644 --- a/common/tasks/apt.py +++ b/common/tasks/apt.py @@ -23,11 +23,14 @@ class AddDefaultSources(Task): @classmethod 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') - 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') + sections = 'main' + if 'sections' in info.manifest.system: + sections = ' '.join(info.manifest.system['sections']) + info.source_lists.add('main', 'deb {apt_mirror} {system.release} '+sections) + info.source_lists.add('main', 'deb-src {apt_mirror} {system.release} '+sections) + if info.manifest.system['release'] in {'testing', 'unstable'}: + info.source_lists.add('main', 'deb {apt_mirror} {system.release}-updates '+sections) + info.source_lists.add('main', 'deb-src {apt_mirror} {system.release}-updates '+sections) class InstallTrustedKeys(Task): diff --git a/manifests/ec2-ebs-debian-unstable-contrib-amd64-pvm.manifest.json b/manifests/ec2-ebs-debian-unstable-contrib-amd64-pvm.manifest.json new file mode 100644 index 0000000..61180df --- /dev/null +++ b/manifests/ec2-ebs-debian-unstable-contrib-amd64-pvm.manifest.json @@ -0,0 +1,45 @@ +{ + "provider": "ec2", + "virtualization": "pvm", + "credentials": { + // "access-key": null, + // "secret-key": null + }, + + "bootstrapper": { + "workspace": "/target" + }, + "image": { + "name": "debian-{system.release}-{system.architecture}-{virtualization}-{%Y}-{%m}-{%d}-ebs", + "description": "Debian {system.release} {system.architecture}" + }, + "system": { + "release": "unstable", + "sections": ["main", "contrib", "non-free"], + "architecture": "amd64", + "bootloader": "pvgrub", + "timezone": "UTC", + "locale": "en_US", + "charmap": "UTF-8" + }, + "packages": { + "mirror": "http://cloudfront.debian.net/debian" + }, + "volume": { + "backing": "ebs", + "partitions": { + "type": "none", + "root": { + "size": "8GiB", + "filesystem": "ext4" + } + } + }, + "plugins": { + "cloud_init": { + "username": "admin", + //"metadata_sources": "Ec2", + "disable_modules": [ "landscape", "byobu", "ssh-import-id" ] + } + } +} From f3195b5f6b4125ba6d5d2426a424962d001e4f00 Mon Sep 17 00:00:00 2001 From: Tomasz Rybak Date: Sat, 25 Jan 2014 16:49:59 +0100 Subject: [PATCH 2/3] Add example testing manifest and configuration, fix apt sources configuration. --- common/tasks/apt.py | 2 +- common/tasks/network-configuration.json | 3 ++ ...ebs-debian-testing-amd64-pvm.manifest.json | 44 +++++++++++++++++++ providers/ec2/tasks/packages-kernels.json | 3 ++ 4 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 manifests/ec2-ebs-debian-testing-amd64-pvm.manifest.json diff --git a/common/tasks/apt.py b/common/tasks/apt.py index 5dc3446..b0a2f75 100644 --- a/common/tasks/apt.py +++ b/common/tasks/apt.py @@ -28,7 +28,7 @@ class AddDefaultSources(Task): sections = ' '.join(info.manifest.system['sections']) info.source_lists.add('main', 'deb {apt_mirror} {system.release} '+sections) info.source_lists.add('main', 'deb-src {apt_mirror} {system.release} '+sections) - if info.manifest.system['release'] in {'testing', 'unstable'}: + if info.manifest.system['release'] not in {'testing', 'unstable'}: info.source_lists.add('main', 'deb {apt_mirror} {system.release}-updates '+sections) info.source_lists.add('main', 'deb-src {apt_mirror} {system.release}-updates '+sections) diff --git a/common/tasks/network-configuration.json b/common/tasks/network-configuration.json index 0a12c4c..44e540b 100644 --- a/common/tasks/network-configuration.json +++ b/common/tasks/network-configuration.json @@ -7,6 +7,9 @@ "wheezy": [ "auto eth0", "iface eth0 inet dhcp" ], + "testing": [ + "auto eth0", + "iface eth0 inet dhcp" ], "unstable": [ "auto eth0", "iface eth0 inet dhcp" ] diff --git a/manifests/ec2-ebs-debian-testing-amd64-pvm.manifest.json b/manifests/ec2-ebs-debian-testing-amd64-pvm.manifest.json new file mode 100644 index 0000000..28c3826 --- /dev/null +++ b/manifests/ec2-ebs-debian-testing-amd64-pvm.manifest.json @@ -0,0 +1,44 @@ +{ + "provider": "ec2", + "virtualization": "pvm", + "credentials": { + // "access-key": null, + // "secret-key": null + }, + + "bootstrapper": { + "workspace": "/target" + }, + "image": { + "name": "debian-{system.release}-{system.architecture}-{virtualization}-{%Y}-{%m}-{%d}-ebs", + "description": "Debian {system.release} {system.architecture}" + }, + "system": { + "release": "testing", + "architecture": "amd64", + "bootloader": "pvgrub", + "timezone": "UTC", + "locale": "en_US", + "charmap": "UTF-8" + }, + "packages": { + "mirror": "http://cloudfront.debian.net/debian" + }, + "volume": { + "backing": "ebs", + "partitions": { + "type": "none", + "root": { + "size": "8GiB", + "filesystem": "ext4" + } + } + }, + "plugins": { + "cloud_init": { + "username": "admin", + //"metadata_sources": "Ec2", + "disable_modules": [ "landscape", "byobu", "ssh-import-id" ] + } + } +} diff --git a/providers/ec2/tasks/packages-kernels.json b/providers/ec2/tasks/packages-kernels.json index 5710578..74a3df7 100644 --- a/providers/ec2/tasks/packages-kernels.json +++ b/providers/ec2/tasks/packages-kernels.json @@ -5,6 +5,9 @@ "wheezy": { "amd64": "linux-image-amd64", "i386" : "linux-image-686" }, + "testing": { + "amd64": "linux-image-amd64", + "i386" : "linux-image-686" }, "unstable": { "amd64": "linux-image-amd64", "i386" : "linux-image-686" } From f5eb071becdc690808ac0debf914a6cf11057f11 Mon Sep 17 00:00:00 2001 From: Tomasz Rybak Date: Sat, 25 Jan 2014 17:08:35 +0100 Subject: [PATCH 3/3] Add minItems to ensure that we always have proper sources.list. --- base/manifest-schema.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/base/manifest-schema.json b/base/manifest-schema.json index 5ecf1da..a5d09c3 100644 --- a/base/manifest-schema.json +++ b/base/manifest-schema.json @@ -26,7 +26,10 @@ "type": "object", "properties": { "release": { "enum": ["wheezy", "testing", "unstable"] }, - "sections": { "type": "array" }, + "sections": { + "type": "array", + "minItems": 1 + }, "architecture": { "enum": ["i386", "amd64"] }, "bootloader": { "enum": ["pvgrub", "grub", "extlinux"] }, "timezone": { "type": "string" },