From cc00d28e00c22c6dd476f62799ede2436f6689de Mon Sep 17 00:00:00 2001 From: Kevin Olbrich Date: Mon, 20 Jan 2020 09:49:39 +0100 Subject: [PATCH] add debian bullseye support --- bootstrapvz/common/releases.py | 9 +++++---- bootstrapvz/common/tasks/network-configuration.yml | 3 +++ bootstrapvz/plugins/cloud_init/manifest-schema.yml | 1 + bootstrapvz/plugins/puppet/tasks.py | 9 +++++++-- bootstrapvz/providers/ec2/tasks/packages-kernels.yml | 3 +++ bootstrapvz/providers/gce/tasks/packages-kernels.yml | 2 ++ bootstrapvz/providers/kvm/tasks/packages-kernels.yml | 4 ++++ tests/unit/releases_tests.py | 6 +++--- 8 files changed, 28 insertions(+), 9 deletions(-) diff --git a/bootstrapvz/common/releases.py b/bootstrapvz/common/releases.py index 7a6808c..b243249 100644 --- a/bootstrapvz/common/releases.py +++ b/bootstrapvz/common/releases.py @@ -31,7 +31,8 @@ class _ReleaseAlias(_Release): return self.alias -sid = _Release('sid', 11) +sid = _Release('sid', 12) +bullseye = _Release('bullseye', 11) buster = _Release('buster', 10) stretch = _Release('stretch', 9) jessie = _Release('jessie', 8) @@ -49,9 +50,9 @@ rex = _Release('rex', 1.2) buzz = _Release('buzz', 1.1) unstable = _ReleaseAlias('unstable', sid) -testing = _ReleaseAlias('testing', buster) -stable = _ReleaseAlias('stable', stretch) -oldstable = _ReleaseAlias('oldstable', jessie) +testing = _ReleaseAlias('testing', bullseye) +stable = _ReleaseAlias('stable', buster) +oldstable = _ReleaseAlias('oldstable', stretch) def get_release(release_name): diff --git a/bootstrapvz/common/tasks/network-configuration.yml b/bootstrapvz/common/tasks/network-configuration.yml index b7a07ed..1e12b11 100644 --- a/bootstrapvz/common/tasks/network-configuration.yml +++ b/bootstrapvz/common/tasks/network-configuration.yml @@ -14,6 +14,9 @@ stretch: | buster: | auto eth0 iface eth0 inet dhcp +bullseye: | + auto eth0 + iface eth0 inet dhcp sid: | auto eth0 iface eth0 inet dhcp diff --git a/bootstrapvz/plugins/cloud_init/manifest-schema.yml b/bootstrapvz/plugins/cloud_init/manifest-schema.yml index dde0974..9d152da 100644 --- a/bootstrapvz/plugins/cloud_init/manifest-schema.yml +++ b/bootstrapvz/plugins/cloud_init/manifest-schema.yml @@ -15,6 +15,7 @@ properties: - stable - stretch - buster + - bullseye - testing - sid - unstable diff --git a/bootstrapvz/plugins/puppet/tasks.py b/bootstrapvz/plugins/puppet/tasks.py index 6de8951..4950090 100644 --- a/bootstrapvz/plugins/puppet/tasks.py +++ b/bootstrapvz/plugins/puppet/tasks.py @@ -3,10 +3,11 @@ from bootstrapvz.base import Task from bootstrapvz.common import phases from bootstrapvz.common.tasks import apt from bootstrapvz.common.exceptions import TaskError -from bootstrapvz.common.releases import jessie, wheezy, stretch, buster +from bootstrapvz.common.releases import jessie, wheezy, stretch, buster, bullseye from bootstrapvz.common.tools import sed_i, log_check_call, rel_path +ASSETS_DIR_BULLSEYE = rel_path(__file__, 'assets/gpg-keyrings-PC1/bullseye') ASSETS_DIR_BUSTER = rel_path(__file__, 'assets/gpg-keyrings-PC1/buster') ASSETS_DIR_STRETCH = rel_path(__file__, 'assets/gpg-keyrings-PC1/stretch') ASSETS_DIR_JESSIE = rel_path(__file__, 'assets/gpg-keyrings-PC1/jessie') @@ -19,7 +20,7 @@ class CheckRequestedDebianRelease(Task): @classmethod def run(cls, info): - if info.manifest.release not in (jessie, wheezy, stretch, buster): + if info.manifest.release not in (jessie, wheezy, stretch, buster, bullseye): msg = 'Debian {info.manifest.release} is not (yet) available in the Puppetlabs.com APT repository.' raise TaskError(msg) @@ -64,6 +65,8 @@ class InstallPuppetlabsPC1ReleaseKey(Task): @classmethod def run(cls, info): from shutil import copy + if (info.manifest.release == bullseye): + key_path = os.path.join(ASSETS_DIR_BULLSEYE, 'puppetlabs-pc1-keyring.gpg') if (info.manifest.release == buster): key_path = os.path.join(ASSETS_DIR_BUSTER, 'puppetlabs-pc1-keyring.gpg') if (info.manifest.release == stretch): @@ -82,6 +85,8 @@ class AddPuppetlabsPC1SourcesList(Task): @classmethod def run(cls, info): + if (info.manifest.release == bullseye): + info.source_lists.add('puppetlabs', 'deb http://apt.puppetlabs.com bullseye PC1') if (info.manifest.release == buster): info.source_lists.add('puppetlabs', 'deb http://apt.puppetlabs.com buster PC1') if (info.manifest.release == stretch): diff --git a/bootstrapvz/providers/ec2/tasks/packages-kernels.yml b/bootstrapvz/providers/ec2/tasks/packages-kernels.yml index e618b3d..4129711 100644 --- a/bootstrapvz/providers/ec2/tasks/packages-kernels.yml +++ b/bootstrapvz/providers/ec2/tasks/packages-kernels.yml @@ -12,6 +12,9 @@ stretch: buster: amd64: linux-image-amd64 i386: linux-image-686-pae +bullseye: + amd64: linux-image-amd64 + i386: linux-image-686-pae sid: amd64: linux-image-amd64 i386: linux-image-686-pae diff --git a/bootstrapvz/providers/gce/tasks/packages-kernels.yml b/bootstrapvz/providers/gce/tasks/packages-kernels.yml index 86b280b..2d19460 100644 --- a/bootstrapvz/providers/gce/tasks/packages-kernels.yml +++ b/bootstrapvz/providers/gce/tasks/packages-kernels.yml @@ -8,5 +8,7 @@ stretch: amd64: linux-image-amd64 buster: amd64: linux-image-amd64 +bullseye: + amd64: linux-image-amd64 sid: amd64: linux-image-amd64 diff --git a/bootstrapvz/providers/kvm/tasks/packages-kernels.yml b/bootstrapvz/providers/kvm/tasks/packages-kernels.yml index 82b8c2b..ca0ab68 100644 --- a/bootstrapvz/providers/kvm/tasks/packages-kernels.yml +++ b/bootstrapvz/providers/kvm/tasks/packages-kernels.yml @@ -15,6 +15,10 @@ buster: amd64: linux-image-amd64 i386: linux-image-686-pae arm64: linux-image-arm64 +bullseye: + amd64: linux-image-amd64 + i386: linux-image-686-pae + arm64: linux-image-arm64 sid: amd64: linux-image-amd64 i386: linux-image-686-pae diff --git a/tests/unit/releases_tests.py b/tests/unit/releases_tests.py index df446ea..7695647 100644 --- a/tests/unit/releases_tests.py +++ b/tests/unit/releases_tests.py @@ -35,9 +35,9 @@ def test_not_identity(): def test_alias(): - assert releases.oldstable == releases.jessie - assert releases.stable == releases.stretch - assert releases.testing == releases.buster + assert releases.oldstable == releases.stretch + assert releases.stable == releases.buster + assert releases.testing == releases.bullseye assert releases.unstable == releases.sid