2016-04-04 06:35:09 +08:00
|
|
|
---
|
2019-09-05 02:35:20 +08:00
|
|
|
- name: enable mirroring on the pool
|
2021-03-03 22:43:50 +08:00
|
|
|
command: "{{ container_exec_cmd | default('') }} rbd --cluster {{ cluster }} --keyring /etc/ceph/{{ cluster }}.client.rbd-mirror.{{ ansible_facts['hostname'] }}.keyring --name client.rbd-mirror.{{ ansible_facts['hostname'] }} mirror pool enable {{ ceph_rbd_mirror_pool }} {{ ceph_rbd_mirror_mode }}"
|
2018-10-30 22:51:32 +08:00
|
|
|
changed_when: false
|
2019-09-05 02:35:20 +08:00
|
|
|
|
2019-10-15 23:32:40 +08:00
|
|
|
- name: list mirroring peer
|
2021-03-03 22:43:50 +08:00
|
|
|
command: "{{ container_exec_cmd | default('') }} rbd --cluster {{ cluster }} --keyring /etc/ceph/{{ cluster }}.client.rbd-mirror.{{ ansible_facts['hostname'] }}.keyring --name client.rbd-mirror.{{ ansible_facts['hostname'] }} mirror pool info {{ ceph_rbd_mirror_pool }}"
|
2019-10-15 23:32:40 +08:00
|
|
|
changed_when: false
|
|
|
|
register: mirror_peer
|
|
|
|
|
2019-09-05 02:35:20 +08:00
|
|
|
- name: add a mirroring peer
|
2021-03-03 22:43:50 +08:00
|
|
|
command: "{{ container_exec_cmd | default('') }} rbd --cluster {{ cluster }} --keyring /etc/ceph/{{ cluster }}.client.rbd-mirror.{{ ansible_facts['hostname'] }}.keyring --name client.rbd-mirror.{{ ansible_facts['hostname'] }} mirror pool peer add {{ ceph_rbd_mirror_pool }} {{ ceph_rbd_mirror_remote_user }}@{{ ceph_rbd_mirror_remote_cluster }}"
|
2019-09-05 02:35:20 +08:00
|
|
|
changed_when: false
|
2021-03-24 23:47:56 +08:00
|
|
|
when: ceph_rbd_mirror_remote_user not in mirror_peer.stdout
|