From 255be99bc570ae0aeca0d80c1b1f43437de7d49c 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 d10d1282d..0bf0dfe6d 100644 --- a/roles/ceph-validate/tasks/main.yml +++ b/roles/ceph-validate/tasks/main.yml @@ -208,3 +208,9 @@ when: - radosgw_frontend_type == 'civetweb' - radosgw_civetweb_num_threads is defined + +- name: include check_rbdmirror.yml + include_tasks: check_rbdmirror.yml + when: + - rbdmirror_group_name in group_names + - ceph_rbd_mirror_configure | default(false) | bool -- 2.39.5