ceph-validate: start with ansible version test

It doesn't make sense to start validating configuration if the ansible
version isn't the good one.
This commit moves the check_system task as the first task in the
ceph-validate role.
The ansible version test tasks are moved at the top of this file.
Also moving the iscsi kernel tests from check_system to check_iscsi
file.

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
(cherry picked from commit 1a77dd7e91)
pull/5113/head
Dimitri Savineau 2019-12-06 16:11:51 -05:00 committed by Guillaume Abrioux
parent 5a51bd12dc
commit 8cc2f8f21e
3 changed files with 34 additions and 35 deletions

View File

@ -24,3 +24,22 @@
- item.status == "present"
- item.chap
- " '' in client_connections | selectattr('status', 'match', 'present') | map(attribute='chap') | list"
- name: check if iscsi gateways is target on supported distros and versions
block:
- name: fail on unsupported distribution for iscsi gateways
fail:
msg: "iSCSI gateways can only be deployed on Red Hat Enterprise Linux, CentOS or Fedora"
when: ansible_distribution not in ['RedHat', 'CentOS', 'Fedora']
- name: fail on unsupported distribution version for iscsi gateways
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

View File

@ -1,4 +1,16 @@
---
- name: fail on unsupported ansible version (1.X)
fail:
msg: "Ansible version must be >= 2.8.x, please update!"
when: ansible_version.major|int < 2
- name: fail on unsupported ansible version
fail:
msg: "Ansible version must be 2.8!"
when:
- ansible_version.major|int == 2
- ansible_version.minor|int != 8
- name: fail on unsupported system
fail:
msg: "System not supported {{ ansible_system }}"
@ -53,39 +65,7 @@
- ansible_distribution == 'openSUSE Leap'
- ansible_distribution_major_version != '15'
- name: fail on unsupported ansible version (1.X)
fail:
msg: "Ansible version must be >= 2.8.x, please update!"
when: ansible_version.major|int < 2
- name: fail on unsupported ansible version
fail:
msg: "Ansible version must be 2.8!"
when:
- ansible_version.major|int == 2
- ansible_version.minor|int != 8
- name: fail if systemd is not present
fail:
msg: "Systemd must be present"
when: ansible_service_mgr != 'systemd'
- name: check if iscsi gateways is target on supported distros and versions
block:
- name: fail on unsupported distribution for iscsi gateways
fail:
msg: "iSCSI gateways can only be deployed on Red Hat Enterprise Linux, CentOS or Fedora"
when: ansible_distribution not in ['RedHat', 'CentOS', 'Fedora']
- name: fail on unsupported distribution version for iscsi gateways
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

View File

@ -1,4 +1,7 @@
---
- name: include check_system.yml
include_tasks: check_system.yml
- name: validate repository variables in non-containerized scenario
when: not containerized_deployment | bool
block:
@ -134,9 +137,6 @@
- osd_objectstore == 'filestore'
- osd_group_name in group_names
- name: include check_system.yml
include_tasks: check_system.yml
- name: include check_devices.yml
include_tasks: check_devices.yml
when: