Merge pull request #1974 from ceph/mgr-upgrade-luminous

upgrade: a support for mgrs
pull/1979/head
Sébastien Han 2017-10-03 19:57:31 +02:00 committed by GitHub
commit f37e014a65
2 changed files with 77 additions and 2 deletions

View File

@ -94,6 +94,7 @@
roles: roles:
- ceph-defaults - ceph-defaults
- ceph-config
- { role: ceph-common, when: not containerized_deployment } - { role: ceph-common, when: not containerized_deployment }
- { role: ceph-docker-common, when: containerized_deployment } - { role: ceph-docker-common, when: containerized_deployment }
- ceph-mon - ceph-mon
@ -232,6 +233,7 @@
roles: roles:
- ceph-defaults - ceph-defaults
- ceph-config
- { role: ceph-common, when: not containerized_deployment } - { role: ceph-common, when: not containerized_deployment }
- { role: ceph-docker-common, when: containerized_deployment } - { role: ceph-docker-common, when: containerized_deployment }
- ceph-osd - ceph-osd
@ -383,6 +385,7 @@
roles: roles:
- ceph-defaults - ceph-defaults
- ceph-config
- { role: ceph-common, when: not containerized_deployment } - { role: ceph-common, when: not containerized_deployment }
- { role: ceph-docker-common, when: containerized_deployment } - { role: ceph-docker-common, when: containerized_deployment }
- ceph-mds - ceph-mds
@ -456,6 +459,7 @@
roles: roles:
- ceph-defaults - ceph-defaults
- ceph-config
- { role: ceph-common, when: not containerized_deployment } - { role: ceph-common, when: not containerized_deployment }
- { role: ceph-docker-common, when: containerized_deployment } - { role: ceph-docker-common, when: containerized_deployment }
- ceph-rgw - ceph-rgw
@ -505,5 +509,76 @@
roles: roles:
- ceph-defaults - ceph-defaults
- ceph-common - ceph-config
- { role: ceph-common, when: not containerized_deployment }
- { role: ceph-docker-common, when: containerized_deployment }
- ceph-client - ceph-client
- name: upgrade ceph mgr node
vars:
upgrade_ceph_packages: True
hosts:
- "{{ mgr_group_name|default('mgrs') }}"
serial: 1
become: True
pre_tasks:
# this task has a failed_when: false to handle the scenario where no mgr existed before the upgrade
- name: stop ceph mgrs
service:
name: ceph-mgr@{{ ansible_hostname }}
state: stopped
enabled: yes
failed_when: false
when:
- not containerized_deployment
roles:
- ceph-defaults
- ceph-config
- { role: ceph-common, when: not containerized_deployment }
- { role: ceph-docker-common, when: containerized_deployment }
- { role: ceph-mgr, when: "ceph_release_num.{{ ceph_release }} >= ceph_release_num.luminous" }
post_tasks:
- name: start ceph mgrs
service:
name: ceph-mgr@{{ ansible_hostname }}
state: started
enabled: yes
when:
- not containerized_deployment
- name: restart containerized ceph mgrs
service:
name: ceph-mgr@{{ ansible_hostname }}
state: restarted
enabled: yes
when:
- containerized_deployment
- name: show ceph status
hosts:
- "{{ mon_group_name|default('mons') }}"
become: True
roles:
- ceph-defaults
tasks:
- name: set_fact docker_exec_cmd_status
set_fact:
docker_exec_cmd_status: "docker exec ceph-mon-{{ hostvars[groups[mon_group_name][0]]['ansible_hostname'] }}"
when:
- containerized_deployment
- name: show ceph status
command: "{{ docker_exec_cmd_status|default('') }} ceph --cluster {{ cluster }} -s"
delegate_to: "{{ groups[mon_group_name][0] }}"

View File

@ -7,9 +7,9 @@
- /var/lib/ceph - /var/lib/ceph
changed_when: false changed_when: false
when: when:
- containerized_deployment
- sestatus is defined - sestatus is defined
- sestatus.stdout != 'Disabled' - sestatus.stdout != 'Disabled'
- containerized_deployment
- name: copy ceph admin keyring - name: copy ceph admin keyring
copy: copy: