]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
adopt: fix rbd-mirror adoption v6.0.25
authorGuillaume Abrioux <gabrioux@redhat.com>
Wed, 9 Feb 2022 16:29:29 +0000 (17:29 +0100)
committerGuillaume Abrioux <gabrioux@redhat.com>
Thu, 10 Feb 2022 07:49:43 +0000 (08:49 +0100)
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 94e51d5c14719fa08477a8df1c5cf05d359b5ab5)

infrastructure-playbooks/cephadm-adopt.yml

index 8fa6da66f81fe8e20b3d8a2f92df934283386cd8..24ed0632dd51ac2b282f4e2a1ab2035a871bc54a 100644 (file)
 
         - name: set_fact mirror_peer_found
           set_fact:
-            mirror_peer_uuid: "{{ ((mirror_pool_info.stdout | from_json | default('{}'))['peers'] | selectattr('site_name', 'match', '^'+ceph_rbd_mirror_remote_cluster+'$') | map(attribute='uuid') | list) }}"
+            mirror_peer_uuid: "{{ ((mirror_pool_info.stdout | default('{}') | from_json)['peers'] | selectattr('site_name', 'match', '^'+ceph_rbd_mirror_remote_cluster+'$') | map(attribute='uuid') | list) }}"
 
         - name: remove current rbd mirror peer, add new peer into mon config store
           when: mirror_peer_uuid | length > 0
               register: remote_user_keyring
 
             - name: get quorum_status
-              command: "{{ cephadm_cmd }} shell --fsid {{ fsid }} -- ceph --cluster {{ cluster }} quorum_status --format json"
+              command: "{{ ceph_cmd }} quorum_status --format json"
               changed_when: false
               delegate_to: "{{ groups[mon_group_name][0] }}"
               register: quorum_status
               run_once: true
 
             - name: remove current mirror peer
-              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] }}"
+              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] }}"
               delegate_to: "{{ groups.get(mon_group_name | default('mons'))[0] }}"
               changed_when: false