]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
ceph-validate: use kernel validation for iscsi
authorDimitri Savineau <dsavinea@redhat.com>
Thu, 18 Apr 2019 13:37:07 +0000 (09:37 -0400)
committerGuillaume Abrioux <gabrioux@redhat.com>
Tue, 21 May 2019 07:17:46 +0000 (09:17 +0200)
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 <dsavinea@redhat.com>
(cherry picked from commit 0c7fd79865d216d1caa1228bbbc9c021551ab12c)

roles/ceph-validate/tasks/check_system.yml

index cec5b7f654c10567a1d385858effd69bcc6e637d..8f0b813077073a21d8ef6be0c1003b38968232f6 100644 (file)
       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