Skip to content

Commit

Permalink
validate: check virtual_ips variable
Browse files Browse the repository at this point in the history
This commit checks the length of `virtual_ips` doesn't exceed the length
of `groups[rgwloadbalancer_group_name]`.
It also ensure this variable is defined when
`groups[rgwloadbalancer_group_name]` contains at least one node.

Signed-off-by: Guillaume Abrioux <[email protected]>
(cherry picked from commit 3b63e06)
  • Loading branch information
guits committed May 5, 2021
1 parent 97066a1 commit 6999118
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions roles/ceph-validate/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -225,3 +225,18 @@
- ceph_docker_registry_auth | bool
- (ceph_docker_registry_username is not defined or ceph_docker_registry_password is not defined) or
(ceph_docker_registry_username | length == 0 or ceph_docker_registry_password | length == 0)

- name: check virtual_ips is defined
fail:
msg: "virtual_ips is not defined."
when:
- rgwloadbalancer_group_name in group_names
- groups[rgwloadbalancer_group_name] | length > 0
- virtual_ips is not defined

- name: validate virtual_ips length
fail:
msg: "There are more virual_ips defined than rgwloadbalancer nodes"
when:
- rgwloadbalancer_group_name in group_names
- (virtual_ips | length) > (groups[rgwloadbalancer_group_name] | length)

0 comments on commit 6999118

Please sign in to comment.