2018-09-29 05:23:10 +08:00
|
|
|
---
|
2019-05-31 00:28:34 +08:00
|
|
|
- name: set_fact use_new_ceph_iscsi package or old ceph-iscsi-config/cli
|
|
|
|
set_fact:
|
|
|
|
use_new_ceph_iscsi: "{{ (gateway_ip_list | default('0.0.0.0') == '0.0.0.0' and gateway_iqn | default('') | length == 0 and client_connections | default({}) | length == 0 and rbd_devices | default({}) | length == 0) | bool | ternary(true, false) }}"
|
|
|
|
|
2019-05-30 23:54:04 +08:00
|
|
|
- name: make sure gateway_ip_list is configured
|
|
|
|
fail:
|
|
|
|
msg: "you must set a list of IPs (comma separated) for gateway_ip_list"
|
2019-05-30 23:55:45 +08:00
|
|
|
when:
|
|
|
|
- "gateway_ip_list | default('0.0.0.0') == '0.0.0.0'"
|
|
|
|
- not containerized_deployment | bool
|
2019-05-31 00:28:34 +08:00
|
|
|
- not use_new_ceph_iscsi | bool
|
2019-05-30 23:54:04 +08:00
|
|
|
|
2018-09-29 05:23:10 +08:00
|
|
|
- name: fail if unsupported chap configuration
|
|
|
|
fail:
|
|
|
|
msg: "Mixing clients with CHAP enabled and disabled is not supported."
|
|
|
|
with_items: "{{ client_connections | default({}) }}"
|
|
|
|
when:
|
|
|
|
- item.status is defined
|
|
|
|
- item.status == "present"
|
2018-11-01 23:03:16 +08:00
|
|
|
- item.chap
|
2018-09-29 05:23:10 +08:00
|
|
|
- " '' in client_connections | selectattr('status', 'match', 'present') | map(attribute='chap') | list"
|