From c8da904f009dfdc58a119ab98ebe67ca17213b6b Mon Sep 17 00:00:00 2001 From: Jesse Pretorius Date: Tue, 1 Nov 2016 10:07:27 +0000 Subject: [PATCH] Add supported Operating System check Regardless of documentation covering the supported Operating Systems for a given release, there are still issues that arise which turn out to relate to someone using an unsupported OS. This patch adds an early pre-requisite check for both an AIO and a full deployment to hard stop the deployment if an unsupported OS is detected on any host. Related-Bug: 1638113 Change-Id: I6bc1a15e1283d496adb82a67989486f814e341c7 --- playbooks/openstack-hosts-setup.yml | 8 ++++++++ tests/roles/bootstrap-host/tasks/check-requirements.yml | 6 +++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/playbooks/openstack-hosts-setup.yml b/playbooks/openstack-hosts-setup.yml index 97b51aab2b..070837f617 100644 --- a/playbooks/openstack-hosts-setup.yml +++ b/playbooks/openstack-hosts-setup.yml @@ -18,6 +18,14 @@ gather_facts: "{{ gather_facts | default(True) }}" max_fail_percentage: 20 user: root + pre_tasks: + - name: Check for a supported Operating System + assert: + that: + - ansible_distribution | lower == 'ubuntu' + - ansible_distribution_release | lower == 'trusty' or + ansible_distribution_release | lower == 'xenial' + msg: "The only supported platforms for this release are Ubuntu 14.04 LTS (Trusty) and Ubuntu 16.04 LTS (Xenial)" roles: - role: "openstack_hosts" tags: diff --git a/tests/roles/bootstrap-host/tasks/check-requirements.yml b/tests/roles/bootstrap-host/tasks/check-requirements.yml index e6279e9982..5691ec9a0c 100644 --- a/tests/roles/bootstrap-host/tasks/check-requirements.yml +++ b/tests/roles/bootstrap-host/tasks/check-requirements.yml @@ -15,7 +15,11 @@ - name: Check for a supported Operating System assert: - that: ansible_distribution | lower == 'ubuntu' + that: + - ansible_distribution | lower == 'ubuntu' + - ansible_distribution_release | lower == 'trusty' or + ansible_distribution_release | lower == 'xenial' + msg: "The only supported platforms for this release are Ubuntu 14.04 LTS (Trusty) and Ubuntu 16.04 LTS (Xenial)" tags: - check-operating-system