From: Dimitri Savineau Date: Thu, 18 Apr 2019 13:37:07 +0000 (-0400) Subject: ceph-validate: use kernel validation for iscsi X-Git-Tag: v5.0.0alpha1~317 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=0c7fd79865d216d1caa1228bbbc9c021551ab12c;p=ceph-ansible.git 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 --- 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