From: Guillaume Abrioux Date: Fri, 15 May 2020 08:58:40 +0000 (+0200) Subject: switch_to_container: refact wait for pg check X-Git-Tag: v5.0.0~8 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=c67b3d35303921d1cec2194a08f10ab9d1457a2f;p=ceph-ansible.git switch_to_container: refact wait for pg check There is no need to make this check with several steps. Signed-off-by: Guillaume Abrioux (cherry picked from commit 8aed824f71e7f4ed53cd9e8e30964eff298c95cf) --- diff --git a/infrastructure-playbooks/switch-from-non-containerized-to-containerized-ceph-daemons.yml b/infrastructure-playbooks/switch-from-non-containerized-to-containerized-ceph-daemons.yml index b830f26a4..044891f00 100644 --- a/infrastructure-playbooks/switch-from-non-containerized-to-containerized-ceph-daemons.yml +++ b/infrastructure-playbooks/switch-from-non-containerized-to-containerized-ceph-daemons.yml @@ -306,12 +306,6 @@ name: ceph-osd post_tasks: - - name: get num_pgs - command: > - {{ container_binary }} exec ceph-mon-{{ hostvars[groups[mon_group_name][0]]['ansible_hostname'] }} ceph --cluster {{ cluster }} -s --format json - register: ceph_pgs - delegate_to: "{{ groups[mon_group_name][0] }}" - - name: container - waiting for clean pgs... command: > {{ container_binary }} exec ceph-mon-{{ hostvars[groups[mon_group_name][0]]['ansible_hostname'] }} ceph --cluster {{ cluster }} -s --format json @@ -319,11 +313,10 @@ until: > (((ceph_health_post.stdout | from_json).pgmap.pgs_by_state | length) > 0) and - (((ceph_health_post.stdout | from_json).pgmap.pgs_by_state | selectattr('state_name', 'search', '^active\\+clean') | map(attribute='count') | list | sum) == (ceph_pgs.stdout | from_json).pgmap.num_pgs) + (((ceph_health_post.stdout | from_json).pgmap.pgs_by_state | selectattr('state_name', 'search', '^active\\+clean') | map(attribute='count') | list | sum) == (ceph_health_post.stdout | from_json).pgmap.num_pgs) delegate_to: "{{ groups[mon_group_name][0] }}" retries: "{{ health_osd_check_retries }}" delay: "{{ health_osd_check_delay }}" - when: (ceph_pgs.stdout | from_json).pgmap.num_pgs != 0 - name: unset osd flags