]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
ceph-validate: add rbdmirror validation
authorDimitri Savineau <dsavinea@redhat.com>
Tue, 5 Nov 2019 16:53:22 +0000 (11:53 -0500)
committerGuillaume Abrioux <gabrioux@redhat.com>
Mon, 13 Jan 2020 15:53:32 +0000 (16:53 +0100)
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 <dsavinea@redhat.com>
(cherry picked from commit 4a065cebd70d259bfd59b6f5f9baa45d516a9c3a)

roles/ceph-validate/tasks/check_rbdmirror.yml [new file with mode: 0644]
roles/ceph-validate/tasks/main.yml

diff --git a/roles/ceph-validate/tasks/check_rbdmirror.yml b/roles/ceph-validate/tasks/check_rbdmirror.yml
new file mode 100644 (file)
index 0000000..f28c075
--- /dev/null
@@ -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
index d10d1282da5a468e2ef8a21312affdb183f8ec8d..0bf0dfe6d44f443e7e601064996a0132246fe0b7 100644 (file)
   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