From bc0f16f270a6e4f8ff9b91413264009b61a7eb45 Mon Sep 17 00:00:00 2001 From: Dimitri Savineau Date: Tue, 5 Nov 2019 11:53:22 -0500 Subject: [PATCH] ceph-validate: add rbdmirror validation When ceph_rbd_mirror_configure is set to true we need to ensure that the required variables aren't empty. Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1760553 Signed-off-by: Dimitri Savineau (cherry picked from commit 4a065cebd70d259bfd59b6f5f9baa45d516a9c3a) --- roles/ceph-validate/tasks/check_rbdmirror.yml | 15 +++++++++++++++ roles/ceph-validate/tasks/main.yml | 6 ++++++ 2 files changed, 21 insertions(+) create mode 100644 roles/ceph-validate/tasks/check_rbdmirror.yml diff --git a/roles/ceph-validate/tasks/check_rbdmirror.yml b/roles/ceph-validate/tasks/check_rbdmirror.yml new file mode 100644 index 000000000..f28c07588 --- /dev/null +++ b/roles/ceph-validate/tasks/check_rbdmirror.yml @@ -0,0 +1,15 @@ +--- +- name: ensure ceph_rbd_mirror_pool is set + fail: + msg: "ceph_rbd_mirror_pool needs to be provided" + when: ceph_rbd_mirror_pool | default("") | length == 0 + +- name: ensure ceph_rbd_mirror_remote_cluster is set + fail: + msg: "ceph_rbd_mirror_remote_cluster needs to be provided" + when: ceph_rbd_mirror_remote_cluster | default("") | length == 0 + +- name: ensure ceph_rbd_mirror_remote_user is set + fail: + msg: "ceph_rbd_mirror_remote_user needs to be provided" + when: ceph_rbd_mirror_remote_user | default("") | length == 0 diff --git a/roles/ceph-validate/tasks/main.yml b/roles/ceph-validate/tasks/main.yml index b650196b8..923eed3a0 100644 --- a/roles/ceph-validate/tasks/main.yml +++ b/roles/ceph-validate/tasks/main.yml @@ -189,6 +189,12 @@ include_tasks: check_nfs.yml when: inventory_hostname in groups.get(nfs_group_name, []) +- name: include check_rbdmirror.yml + include_tasks: check_rbdmirror.yml + when: + - rbdmirror_group_name in group_names + - ceph_rbd_mirror_configure | default(false) | bool + - block: - name: fail if [grafana-server] group doesn't exist fail: