mgr: refact 'wait for all mgr to be up' task

There's no need to use `shell` module here.
Instead of using `| python -c`, let's use `from_json` filter.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
pull/4321/head
Guillaume Abrioux 2019-08-06 11:11:15 +02:00
parent 4c6ec1dccb
commit 5b9b841108
1 changed files with 2 additions and 2 deletions

View File

@ -5,14 +5,14 @@
when: dashboard_enabled | bool
- name: wait for all mgr to be up
shell: "{{ container_exec_cmd_mgr | default('') }} ceph --cluster {{ cluster }} mgr dump -f json | python -c 'import sys, json; print(json.load(sys.stdin)[\"available\"])'"
command: "{{ container_exec_cmd_mgr | default('') }} ceph --cluster {{ cluster }} mgr dump -f json"
register: mgr_dump
retries: 30
delay: 5
delegate_to: "{{ groups[mon_group_name][0] }}"
until:
- mgr_dump.rc == 0
- mgr_dump.stdout | bool
- (mgr_dump.stdout | from_json).available | bool
- name: get enabled modules from ceph-mgr
command: "{{ container_exec_cmd_mgr | default('') }} ceph --cluster {{ cluster }} --format json mgr module ls"