mirror of https://github.com/ceph/ceph-ansible.git
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>
(cherry picked from commit c878e99589
)
pull/4928/head
parent
6e47e96a02
commit
4c4b0edfec
|
@ -506,10 +506,8 @@
|
||||||
when: (ceph_pgs.stdout | from_json).pgmap.num_pgs != 0
|
when: (ceph_pgs.stdout | from_json).pgmap.num_pgs != 0
|
||||||
|
|
||||||
|
|
||||||
- name: unset osd flags
|
- name: complete osd upgrade
|
||||||
|
hosts: "{{ mon_group_name|default('mons') }}[0]"
|
||||||
hosts: "{{ mon_group_name|default('mons') }}"
|
|
||||||
|
|
||||||
become: True
|
become: True
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
|
@ -532,18 +530,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")
|
||||||
|
|
Loading…
Reference in New Issue