update: only run post osd upgrade play on 1 mon

There is no need to run these tasks n times from each monitor.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
pull/4761/head
Guillaume Abrioux 2019-11-18 18:12:00 +01:00 committed by Dimitri Savineau
parent 548db78b95
commit c878e99589
1 changed files with 1 additions and 4 deletions

View File

@ -470,7 +470,7 @@
- name: complete osd upgrade - name: complete osd upgrade
hosts: "{{ mon_group_name|default('mons') }}" hosts: "{{ mon_group_name|default('mons') }}[0]"
become: True become: True
tasks: tasks:
- import_role: - import_role:
@ -492,18 +492,15 @@
- name: get osd versions - name: get osd versions
command: "{{ container_exec_cmd_update_osd|default('') }} ceph --cluster {{ cluster }} versions" command: "{{ container_exec_cmd_update_osd|default('') }} ceph --cluster {{ cluster }} versions"
register: ceph_versions register: ceph_versions
delegate_to: "{{ groups[mon_group_name][0] }}"
- name: set_fact ceph_versions_osd - name: set_fact ceph_versions_osd
set_fact: set_fact:
ceph_versions_osd: "{{ (ceph_versions.stdout|from_json).osd }}" ceph_versions_osd: "{{ (ceph_versions.stdout|from_json).osd }}"
delegate_to: "{{ groups[mon_group_name][0] }}"
# length == 1 means there is a single osds versions entry # length == 1 means there is a single osds versions entry
# thus all the osds are running the same version # thus all the osds are running the same version
- name: complete osds upgrade - name: complete osds upgrade
command: "{{ container_exec_cmd_update_osd|default('') }} ceph --cluster {{ cluster }} osd require-osd-release luminous" command: "{{ container_exec_cmd_update_osd|default('') }} ceph --cluster {{ cluster }} osd require-osd-release luminous"
delegate_to: "{{ groups[mon_group_name][0] }}"
when: when:
- (ceph_versions.get('stdout', '{}')|from_json).get('osd', {}) | length == 1 - (ceph_versions.get('stdout', '{}')|from_json).get('osd', {}) | length == 1
- ceph_versions_osd | string is search("ceph version 12") - ceph_versions_osd | string is search("ceph version 12")