From a9a8718b7292eec9e32ba883ca2cec9fde5ed4fe Mon Sep 17 00:00:00 2001 From: Dmitriy Rabotyagov Date: Thu, 8 Aug 2024 14:00:25 +0200 Subject: [PATCH] Verify OS for containers installation It could easily happen that while target host was upgraded but containers left running old OS. In this case running openstack_hosts role will result in adding weird repo, like adding osbpo on Ubuntu 20.04 as it will be treated as debian due to missing more specific match. Moreover, if running setup-hosts and metal hosts were not updated to supported OS, and will fail during openstack-hosts-setup, this will not prevent containers from attempting running openstack_hosts role. Change-Id: I339bdd11a4c212cd48e9cdf659166ad0af1e84f4 --- playbooks/containers-lxc-create.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/playbooks/containers-lxc-create.yml b/playbooks/containers-lxc-create.yml index 2b0fd235c3..0a10a79d69 100644 --- a/playbooks/containers-lxc-create.yml +++ b/playbooks/containers-lxc-create.yml @@ -89,6 +89,16 @@ tags: - lxc-containers-create pre_tasks: + - name: Check for a supported Operating System + assert: + that: + - (ansible_facts['distribution'] == 'Debian' and ansible_facts['distribution_release'] == 'bullseye') or + (ansible_facts['distribution'] == 'Debian' and ansible_facts['distribution_release'] == 'bookworm') or + (ansible_facts['distribution'] == 'Ubuntu' and ansible_facts['distribution_release'] == 'jammy') or + (ansible_facts['os_family'] == 'RedHat' and ansible_facts['distribution_major_version'] == '9') + msg: > + The only supported platforms for this release are Debian 11 (Bullseye), Debian 12 (Bookworm) + Ubuntu 22.04 (Jammy), CentOS 9 Stream, and Rocky Linux 9. - name: Setup installation variables include_role: name: openstack.osa.install_defaults