The rbd mirror configuration was only available for non containerized
deployment and was also imcomplete.
We now enable the mirroring on the pool and add the remote peer in both
scenarios.
The default mirroring mode is set to 'pool' but can be configured via
the ceph_rbd_mirror_mode variable.
This commit also fixes an issue on the rbd mirror command if the ceph
cluster name isn't using the default value (ceph) due to a missing
--cluster parameter to the command.
Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1665877
Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
(cherry picked from commit
7e5e21741eb0143e3d981dc1891253ad331d9753)
#ceph_rbd_mirror_configure: false
#ceph_rbd_mirror_pool: ""
+#ceph_rbd_mirror_mode: pool
# NOTE (leseb): the following variable needs the name of the remote cluster.
# The name of this cluster must be different than your local cluster simply
ceph_rbd_mirror_configure: false
ceph_rbd_mirror_pool: ""
+ceph_rbd_mirror_mode: pool
# NOTE (leseb): the following variable needs the name of the remote cluster.
# The name of this cluster must be different than your local cluster simply
---
-- name: add a peer
- shell: "rbd mirror pool peer add {{ ceph_rbd_mirror_pool }} {{ ceph_rbd_mirror_remote_user }}@{{ ceph_rbd_mirror_remote_cluster }}"
+- name: enable mirroring on the pool
+ command: "{{ docker_exec_cmd | default('') }} rbd --cluster {{ cluster }} mirror pool enable {{ ceph_rbd_mirror_pool }} {{ ceph_rbd_mirror_mode }}"
+ changed_when: false
+
+- name: add a mirroring peer
+ shell: "{{ docker_exec_cmd | default('') }} rbd --cluster {{ cluster }} mirror pool peer add {{ ceph_rbd_mirror_pool }} {{ ceph_rbd_mirror_remote_user }}@{{ ceph_rbd_mirror_remote_cluster }}"
+ changed_when: false
+ failed_when: false
when:
- not containerized_deployment
-- name: include configure_mirroring.yml
- include_tasks: configure_mirroring.yml
- when:
- - ceph_rbd_mirror_configure
- - not containerized_deployment
-
- name: include docker/main.yml
include_tasks: docker/main.yml
when:
- containerized_deployment
+
+- name: include configure_mirroring.yml
+ include_tasks: configure_mirroring.yml
+ when: ceph_rbd_mirror_configure | bool