#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
- command: "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: "{{ container_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
+ command: "{{ container_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: cephx | bool
- name: tasks for non-containerized deployment
+ include_tasks: start_rbd_mirror.yml
when: not containerized_deployment | bool
- block:
- - name: include start_rbd_mirror.yml
- include_tasks: start_rbd_mirror.yml
-
- - name: include configure_mirroring.yml
- include_tasks: configure_mirroring.yml
- when: ceph_rbd_mirror_configure | bool
- name: tasks for containerized deployment
when: containerized_deployment | bool
- name: include container/main.yml
include_tasks: container/main.yml
+
+- name: include configure_mirroring.yml
+ include_tasks: configure_mirroring.yml
+ when: ceph_rbd_mirror_configure | bool