From 78ce0aa0b5ae04cc4c60727427cb19cfdddd4408 Mon Sep 17 00:00:00 2001 From: Dimitri Savineau Date: Thu, 18 Apr 2019 09:37:07 -0400 Subject: [PATCH] ceph-validate: use kernel validation for iscsi Ceph iSCSI gateway requires Red Hat Enterprise Linux or CentOS 7.5 or later. Because we can not check the ansible_distribution_version fact for CentOS with ansible 2.8 (returns only the major version) we can fallback by checking the kernel option. - CONFIG_TARGET_CORE=m - CONFIG_TCM_USER2=m - CONFIG_ISCSI_TARGET=m http://docs.ceph.com/docs/master/rbd/iscsi-target-cli-manual-install/ Signed-off-by: Dimitri Savineau (cherry picked from commit 0c7fd79865d216d1caa1228bbbc9c021551ab12c) --- roles/ceph-validate/tasks/check_system.yml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/roles/ceph-validate/tasks/check_system.yml b/roles/ceph-validate/tasks/check_system.yml index cec5b7f65..8f0b81307 100644 --- a/roles/ceph-validate/tasks/check_system.yml +++ b/roles/ceph-validate/tasks/check_system.yml @@ -78,10 +78,14 @@ when: ansible_distribution not in ['RedHat', 'CentOS', 'Fedora'] - name: fail on unsupported distribution version for iscsi gateways - fail: - msg: "iSCSI gateways can only be deployed on Red Hat Enterprise Linux or CentOS >= 7.4" - when: - - ansible_distribution_version < '7.4' - - ansible_distribution in ['RedHat', 'CentOS'] + command: 'grep -q {{ item }}=m {% if is_atomic|bool %}/usr/lib/ostree-boot{% else %}/boot{% endif %}/config-{{ ansible_kernel }}' + register: iscsi_kernel + changed_when: false + failed_when: iscsi_kernel.rc != 0 + loop: + - CONFIG_TARGET_CORE + - CONFIG_TCM_USER2 + - CONFIG_ISCSI_TARGET + when: ansible_distribution in ['RedHat', 'CentOS'] when: iscsi_gw_group_name in group_names -- 2.39.5