Merge pull request #1012 from ceph/cluster-name-rolling

rolling_update: improve variables import
pull/1016/head v1.0.8
Leseb 2016-10-06 16:07:31 +02:00 committed by GitHub
commit bd50e64665
1 changed files with 82 additions and 22 deletions

View File

@ -28,11 +28,17 @@
invoking the playbook" invoking the playbook"
when: ireallymeanit != 'yes' when: ireallymeanit != 'yes'
- hosts: vars:
- mons mon_group_name: mons
- osds osd_group_name: osds
- mdss mds_group_name: mdss
- rgws rgw_group_name: rgws
hosts:
- "{{ mon_group_name }}"
- "{{ osd_group_name }}"
- "{{ mds_group_name }}"
- "{{ rgw_group_name }}"
become: True become: True
tasks: tasks:
@ -53,20 +59,33 @@
register: is_systemd register: is_systemd
- hosts: mons - name: upgrade ceph mon cluster
serial: 1
become: True
vars: vars:
upgrade_ceph_packages: True
mon_group_name: mons
health_mon_check_retries: 5 health_mon_check_retries: 5
health_mon_check_delay: 10 health_mon_check_delay: 10
hosts:
- "{{ mon_group_name }}"
serial: 1
become: True
roles: roles:
- ceph-common - ceph-common
- ceph-mon - ceph-mon
post_tasks: post_tasks:
- include_vars: ../roles/ceph-common/defaults/main.yml
- include_vars: ../roles/ceph-mon/defaults/main.yml
- include_vars: ../roles/ceph-restapi/defaults/main.yml
- include_vars: ../group_vars/all
failed_when: false
- include_vars: ../group_vars/mons
failed_when: false
- include_vars: ../group_vars/restapis
failed_when: false
- name: restart ceph mons with upstart - name: restart ceph mons with upstart
service: service:
name: ceph-mon name: ceph-mon
@ -102,16 +121,27 @@
delegate_to: "{{ mon_host }}" delegate_to: "{{ mon_host }}"
- hosts: osds - name: upgrade ceph osds cluster
serial: 1
become: True
vars: vars:
upgrade_ceph_packages: True
osd_group_name: osds osd_group_name: osds
health_osd_check_retries: 10 health_osd_check_retries: 10
health_osd_check_delay: 10 health_osd_check_delay: 10
hosts:
- "{{ osd_group_name }}"
serial: 1
become: True
pre_tasks: pre_tasks:
- include_vars: ../roles/ceph-common/defaults/main.yml
- include_vars: ../roles/ceph-osd/defaults/main.yml
- include_vars: ../group_vars/all
failed_when: false
- include_vars: ../group_vars/osds
failed_when: false
- name: set osd flags - name: set osd flags
command: ceph osd set {{ item }} --cluster {{ cluster }} command: ceph osd set {{ item }} --cluster {{ cluster }}
with_items: with_items:
@ -125,6 +155,13 @@
- ceph-osd - ceph-osd
post_tasks: post_tasks:
- include_vars: ../roles/ceph-common/defaults/main.yml
- include_vars: ../roles/ceph-osd/defaults/main.yml
- include_vars: ../group_vars/all
failed_when: false
- include_vars: ../group_vars/osds
failed_when: false
- name: get osd numbers - name: get osd numbers
shell: "if [ -d /var/lib/ceph/osd ] ; then ls /var/lib/ceph/osd | cut -d '-' -f 2 ; fi" shell: "if [ -d /var/lib/ceph/osd ] ; then ls /var/lib/ceph/osd | cut -d '-' -f 2 ; fi"
register: osd_ids register: osd_ids
@ -168,18 +205,29 @@
delegate_to: "{{ groups.mons[0] }}" delegate_to: "{{ groups.mons[0] }}"
- hosts: mdss - name: upgrade ceph mdss cluster
vars:
mds_group_name: mdss
hosts:
- "{{ mds_group_name }}"
serial: 1 serial: 1
become: True become: True
vars:
upgrade_ceph_packages: True
mds_group_name: mdss
roles: roles:
- ceph-common - ceph-common
- ceph-mds - ceph-mds
post_tasks: post_tasks:
- include_vars: ../roles/ceph-common/defaults/main.yml
- include_vars: ../roles/ceph-mds/defaults/main.yml
- include_vars: ../group_vars/all
failed_when: false
- include_vars: ../group_vars/mdss
failed_when: false
- name: restart ceph mdss with upstart - name: restart ceph mdss with upstart
service: service:
name: ceph-mds name: ceph-mds
@ -201,18 +249,30 @@
enabled: yes enabled: yes
when: is_systemd when: is_systemd
- hosts: rgws
- name: upgrade ceph rgws cluster
vars:
rgw_group_name: rgws
hosts:
- "{{ rgw_group_name }}"
serial: 1 serial: 1
become: True become: True
vars:
upgrade_ceph_packages: True
rgw_group_name: rgws
roles: roles:
- ceph-common - ceph-common
- ceph-rgw - ceph-rgw
post_tasks: post_tasks:
- include_vars: ../roles/ceph-common/defaults/main.yml
- include_vars: ../roles/ceph-rgw/defaults/main.yml
- include_vars: ../group_vars/all
failed_when: false
- include_vars: ../group_vars/rgws
failed_when: false
- name: restart ceph rgws with systemd - name: restart ceph rgws with systemd
service: service:
name: ceph-radosgw@rgw.{{ ansible_hostname }} name: ceph-radosgw@rgw.{{ ansible_hostname }}