Merge pull request #1958 from ceph/update-luminous

Update luminous
pull/1959/head
Sébastien Han 2017-09-28 22:43:50 +02:00 committed by GitHub
commit 07ad6bcdb4
1 changed files with 33 additions and 29 deletions

View File

@ -273,46 +273,31 @@
- ansible_service_mgr == 'systemd' - ansible_service_mgr == 'systemd'
- containerized_deployment - containerized_deployment
- name: get pg num
shell: |
ceph --cluster {{ cluster }} -s -f json | python -c 'import sys, json; print(json.load(sys.stdin)["pgmap"]["num_pgs"])'
delegate_to: "{{ groups[mon_group_name][0] }}"
register: num_pgs
when:
- not containerized_deployment
- name: waiting for clean pgs... - name: waiting for clean pgs...
shell: | command: ceph --cluster "{{ cluster }}" -s --format json
test "[""$(ceph --cluster {{ cluster }} -s -f json | python -c 'import sys, json; print(json.load(sys.stdin)["pgmap"]["num_pgs"])')""]" = "$(ceph --cluster {{ cluster }} -s -f json | python -c 'import sys, json; print [ i["count"] for i in json.load(sys.stdin)["pgmap"]["pgs_by_state"] if i["state_name"] == "active+clean"]')" register: ceph_health_post
register: result until: >
until: result.rc == 0 ((ceph_health_post.stdout | from_json).pgmap.pgs_by_state | length) == 1
and
(ceph_health_post.stdout | from_json).pgmap.pgs_by_state.0.state_name == "active+clean"
delegate_to: "{{ groups[mon_group_name][0] }}"
retries: "{{ health_osd_check_retries }}" retries: "{{ health_osd_check_retries }}"
delay: "{{ health_osd_check_delay }}" delay: "{{ health_osd_check_delay }}"
delegate_to: "{{ groups[mon_group_name][0] }}"
when: when:
- not containerized_deployment - not containerized_deployment
- num_pgs.stdout != "0"
- name: container - get pg num
shell: |
docker exec ceph-mon-{{ hostvars[groups[mon_group_name][0]]['ansible_hostname'] }} ceph --cluster {{ cluster }} -s -f json | python -c 'import sys, json; print(json.load(sys.stdin)["pgmap"]["num_pgs"])'
delegate_to: "{{ groups[mon_group_name][0] }}"
register: container_num_pgs
when:
- containerized_deployment
- name: container - waiting for clean pgs... - name: container - waiting for clean pgs...
shell: | command: "docker exec ceph-mon-{{ hostvars[groups[mon_group_name][0]]['ansible_hostname'] }} ceph --cluster {{ cluster }} -s --format json"
test "[""$(docker exec ceph-mon-{{ hostvars[groups[mon_group_name][0]]['ansible_hostname'] }} ceph --cluster {{ cluster }} -s -f json | python -c 'import sys, json; print(json.load(sys.stdin)["pgmap"]["num_pgs"])')""]" = "$(docker exec ceph-mon-{{ hostvars[groups[mon_group_name][0]]['ansible_hostname'] }} ceph --cluster {{ cluster }} -s -f json | python -c 'import sys, json; print [ i["count"] for i in json.load(sys.stdin)["pgmap"]["pgs_by_state"] if i["state_name"] == "active+clean"]')" register: ceph_health_post
register: result until: >
until: result.rc == 0 ((ceph_health_post.stdout | from_json).pgmap.pgs_by_state | length) == 1
and
(ceph_health_post.stdout | from_json).pgmap.pgs_by_state.0.state_name == "active+clean"
delegate_to: "{{ groups[mon_group_name][0] }}"
retries: "{{ health_osd_check_retries }}" retries: "{{ health_osd_check_retries }}"
delay: "{{ health_osd_check_delay }}" delay: "{{ health_osd_check_delay }}"
delegate_to: "{{ groups[mon_group_name][0] }}"
when: when:
- containerized_deployment - containerized_deployment
- container_num_pgs.stdout != "0"
- name: unset osd flags - name: unset osd flags
@ -344,6 +329,25 @@
delegate_to: "{{ groups[mon_group_name][0] }}" delegate_to: "{{ groups[mon_group_name][0] }}"
when: containerized_deployment when: containerized_deployment
- name: get osd versions
command: ceph --cluster {{ cluster }} versions
register: ceph_versions
delegate_to: "{{ groups[mon_group_name][0] }}"
- name: set_fact ceph_versions_osd
set_fact:
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
# thus all the osds are running the same version
- name: complete osds upgrade
command: ceph --cluster {{ cluster }} osd require-osd-release luminous
delegate_to: "{{ groups[mon_group_name][0] }}"
when:
- (ceph_versions.stdout|from_json).osd | length == 1
- ceph_versions_osd | string | search("ceph version 12")
- name: upgrade ceph mdss cluster - name: upgrade ceph mdss cluster