Skip to content

Commit 314ba6e

Browse files
committed
adopt: fix rbd-mirror adoption
We can't use `{{ cephadm_cmd }}` here because the monitors aren't yet adopted. We must use `{{ ceph_cmd }}` instead. This also fixes some filters `| default()` (they must be moved before `| from_json()`) Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1967440 Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com> (cherry picked from commit 94e51d5)
1 parent 371c25f commit 314ba6e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

infrastructure-playbooks/cephadm-adopt.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@
446446

447447
- name: set_fact mirror_peer_found
448448
set_fact:
449-
mirror_peer_uuid: "{{ ((mirror_pool_info.stdout | from_json | default('{}'))['peers'] | selectattr('site_name', 'match', '^'+ceph_rbd_mirror_remote_cluster+'$') | map(attribute='uuid') | list) }}"
449+
mirror_peer_uuid: "{{ ((mirror_pool_info.stdout | default('{}') | from_json)['peers'] | selectattr('site_name', 'match', '^'+ceph_rbd_mirror_remote_cluster+'$') | map(attribute='uuid') | list) }}"
450450

451451
- name: remove current rbd mirror peer, add new peer into mon config store
452452
when: mirror_peer_uuid | length > 0
@@ -457,7 +457,7 @@
457457
register: remote_user_keyring
458458

459459
- name: get quorum_status
460-
command: "{{ cephadm_cmd }} shell --fsid {{ fsid }} -- ceph --cluster {{ cluster }} quorum_status --format json"
460+
command: "{{ ceph_cmd }} quorum_status --format json"
461461
changed_when: false
462462
delegate_to: "{{ groups[mon_group_name][0] }}"
463463
register: quorum_status
@@ -472,7 +472,7 @@
472472
run_once: true
473473

474474
- name: remove current mirror peer
475-
command: "{{ admin_rbd_cmd }} mirror pool peer remove {{ ceph_rbd_mirror_pool }} {{ ((mirror_pool_info.stdout | from_json | default('{}'))['peers'] | selectattr('site_name', 'match', '^'+ceph_rbd_mirror_remote_cluster+'$') | map(attribute='uuid') | list)[0] }}"
475+
command: "{{ admin_rbd_cmd }} mirror pool peer remove {{ ceph_rbd_mirror_pool }} {{ ((mirror_pool_info.stdout | default('{}') | from_json)['peers'] | selectattr('site_name', 'match', '^'+ceph_rbd_mirror_remote_cluster+'$') | map(attribute='uuid') | list)[0] }}"
476476
delegate_to: "{{ groups.get(mon_group_name | default('mons'))[0] }}"
477477
changed_when: false
478478

0 commit comments

Comments
 (0)