From ded9d9dfd37ad1bf9a247be7c84990eecf42d9a4 Mon Sep 17 00:00:00 2001 From: Andrew Schoen Date: Mon, 14 Nov 2016 14:42:52 -0600 Subject: [PATCH] rolling update: stop MDSs before upgrading and start afterwards Signed-off-by: Andrew Schoen Resolves: rhbz#1394929 --- infrastructure-playbooks/rolling_update.yml | 41 ++++++++++++++++++--- 1 file changed, 35 insertions(+), 6 deletions(-) diff --git a/infrastructure-playbooks/rolling_update.yml b/infrastructure-playbooks/rolling_update.yml index adc2332a3..d058b47c8 100644 --- a/infrastructure-playbooks/rolling_update.yml +++ b/infrastructure-playbooks/rolling_update.yml @@ -278,6 +278,35 @@ serial: 1 become: True + pre_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/{{ mds_group_name }} + failed_when: false + + - name: stop ceph mdss with upstart + service: + name: ceph-mds + state: stopped + args: id={{ ansible_hostname }} + when: is_upstart.stat.exists == True + + - name: stop ceph mdss with sysvinit + service: + name: ceph + state: stopped + args: mds + when: is_sysvinit.stat.exists == True + + - name: stop ceph mdss with systemd + service: + name: ceph-mds@{{ ansible_hostname }} + state: stopped + enabled: yes + when: is_systemd + roles: - ceph-common - ceph-mds @@ -290,24 +319,24 @@ - include_vars: group_vars/{{ mds_group_name }} failed_when: false - - name: restart ceph mdss with upstart + - name: start ceph mdss with upstart service: name: ceph-mds - state: restarted + state: started args: id={{ ansible_hostname }} when: is_upstart.stat.exists == True - - name: restart ceph mdss with sysvinit + - name: start ceph mdss with sysvinit service: name: ceph - state: restarted + state: started args: mds when: is_sysvinit.stat.exists == True - - name: restart ceph mdss with systemd + - name: start ceph mdss with systemd service: name: ceph-mds@{{ ansible_hostname }} - state: restarted + state: started enabled: yes when: is_systemd -- 2.39.5