From b90956069c80770d7822d5a0f2ebfa8289068cd4 Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Tue, 22 Nov 2022 09:25:29 +0200 Subject: [PATCH] Fix matrix_architecture sanity check --- roles/custom/matrix-base/tasks/sanity_check.yml | 5 +++++ roles/custom/matrix-base/tasks/system_check.yml | 7 ------- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/roles/custom/matrix-base/tasks/sanity_check.yml b/roles/custom/matrix-base/tasks/sanity_check.yml index 2644d4cf..3a3a5639 100644 --- a/roles/custom/matrix-base/tasks/sanity_check.yml +++ b/roles/custom/matrix-base/tasks/sanity_check.yml @@ -43,6 +43,11 @@ - {'var': matrix_architecture, 'value': "{{ matrix_architecture | default('') }}"} when: "item.value is none or item.value == ''" +- name: Fail if matrix_architecture is set incorrectly + ansible.builtin.fail: + msg: "Detected that variable matrix_architecture {{ matrix_architecture }} appears to be set incorrectly. See docs/alternative-architectures.md. Server appears to be {{ ansible_architecture }}." + when: matrix_architecture not in ['amd64', 'arm32', 'arm64'] + - name: Fail if uppercase domain used ansible.builtin.fail: msg: "Detected that you're using an uppercase domain name - `{{ item }}`. This will cause trouble. Please use all-lowercase!" diff --git a/roles/custom/matrix-base/tasks/system_check.yml b/roles/custom/matrix-base/tasks/system_check.yml index f1d2fc7b..909bdb12 100644 --- a/roles/custom/matrix-base/tasks/system_check.yml +++ b/roles/custom/matrix-base/tasks/system_check.yml @@ -21,10 +21,3 @@ when: - ansible_distribution == 'Archlinux' - ansible_python.version.major != 3 - -- name: Fail if architecture is set incorrectly - ansible.builtin.fail: - msg: "Detected that variable matrix_architecture {{ matrix_architecture }} appears to be set incorrectly. See docs/alternative-architectures.md. Server appears to be {{ ansible_architecture }}." - when: (ansible_architecture == "x86_64" and matrix_architecture != "amd64") or - (ansible_architecture == "aarch64" and matrix_architecture != "arm64") or - (ansible_architecture.startswith("armv") and matrix_architecture != "arm32")