mirror of https://github.com/ceph/ceph-ansible.git
43 lines
1.5 KiB
YAML
43 lines
1.5 KiB
YAML
---
|
|
- 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_facts['distribution'] not in ['RedHat', 'CentOS', 'Fedora']
|
|
|
|
- name: make sure gateway_ip_list is configured
|
|
fail:
|
|
msg: "you must set a list of IPs (comma separated) for gateway_ip_list"
|
|
when:
|
|
- gateway_ip_list == '0.0.0.0'
|
|
- not containerized_deployment | bool
|
|
- not use_new_ceph_iscsi | bool
|
|
|
|
- name: make sure gateway_iqn is configured
|
|
fail:
|
|
msg: "you must set a iqn for the iSCSI target"
|
|
when:
|
|
- gateway_iqn | length == 0
|
|
- not containerized_deployment | bool
|
|
- not use_new_ceph_iscsi | bool
|
|
|
|
- name: fail if unsupported chap configuration
|
|
fail:
|
|
msg: "Mixing clients with CHAP enabled and disabled is not supported."
|
|
with_items: "{{ client_connections }}"
|
|
when:
|
|
- item.status is defined
|
|
- item.status == "present"
|
|
- item.chap
|
|
- " '' in client_connections | selectattr('status', 'match', 'present') | map(attribute='chap') | list"
|
|
|
|
- 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_facts['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_facts['distribution'] in ['RedHat', 'CentOS']
|