validate: check ec_profiles variable

This commit adds a check to validate the `ec_profiles` variable.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
guits-create-ec-profile
Guillaume Abrioux 2021-01-11 14:57:57 +01:00
parent 3a57908b4d
commit 03a2d8be87
1 changed files with 10 additions and 0 deletions

View File

@ -294,3 +294,13 @@
when:
- rgwloadbalancer_group_name in group_names
- (virtual_ips | length) > (groups[rgwloadbalancer_group_name] | length)
- name: validate ec_profiles variable
fail:
msg: "ec_profiles is not defined correctly. "
with_items: "{{ ec_profiles }}"
when:
- ec_profiles is defined
- item.name is not defined or
((item.k is not defined or
item.m is not defined) and (item.state | default('present') == 'present'))