2014-03-04 02:08:51 +08:00
|
|
|
---
|
2014-09-05 03:14:11 +08:00
|
|
|
- name: update apt cache
|
2015-09-04 00:18:53 +08:00
|
|
|
apt:
|
|
|
|
update-cache: yes
|
2014-03-04 02:08:51 +08:00
|
|
|
|
2015-03-03 00:13:30 +08:00
|
|
|
- name: restart ceph mons
|
|
|
|
command: service ceph restart mon
|
2015-06-26 06:26:03 +08:00
|
|
|
when:
|
2016-05-09 22:08:33 +08:00
|
|
|
- socket.rc == 0
|
|
|
|
- ansible_distribution != 'Ubuntu'
|
|
|
|
- mon_group_name in group_names
|
|
|
|
- is_before_infernalis
|
2015-11-21 05:34:29 +08:00
|
|
|
|
|
|
|
- name: restart ceph mons with systemd
|
|
|
|
service:
|
2016-03-03 18:03:03 +08:00
|
|
|
name: ceph-mon@{{ monitor_name }}
|
2015-11-21 05:34:29 +08:00
|
|
|
state: restarted
|
|
|
|
when:
|
2016-05-09 22:08:33 +08:00
|
|
|
- socket.rc == 0
|
|
|
|
- use_systemd
|
|
|
|
- mon_group_name in group_names
|
|
|
|
- is_after_hammer
|
2015-07-01 00:07:03 +08:00
|
|
|
|
|
|
|
- name: restart ceph mons on ubuntu
|
2016-03-29 21:37:31 +08:00
|
|
|
command: initctl restart ceph-mon cluster={{ cluster }} id={{ monitor_name }}
|
2015-07-01 00:07:03 +08:00
|
|
|
when:
|
2016-05-09 22:08:33 +08:00
|
|
|
- socket.rc == 0
|
|
|
|
- ansible_distribution == 'Ubuntu'
|
|
|
|
- not use_systemd
|
|
|
|
- mon_group_name in group_names
|
2014-08-20 20:04:34 +08:00
|
|
|
|
2015-03-03 00:13:30 +08:00
|
|
|
- name: restart ceph osds
|
|
|
|
command: service ceph restart osd
|
2015-06-26 06:26:03 +08:00
|
|
|
when:
|
2016-05-09 22:08:33 +08:00
|
|
|
- socket.rc == 0
|
|
|
|
- ansible_distribution != 'Ubuntu'
|
|
|
|
- osd_group_name in group_names
|
|
|
|
- is_before_infernalis
|
2015-11-21 05:34:29 +08:00
|
|
|
|
|
|
|
# This does not just restart OSDs but everything else too. Unfortunately
|
|
|
|
# at this time the ansible role does not have an OSD id list to use
|
|
|
|
# for restarting them specifically.
|
|
|
|
- name: restart ceph osds with systemd
|
|
|
|
service:
|
|
|
|
name: ceph.target
|
|
|
|
state: restarted
|
|
|
|
when:
|
2016-05-09 22:08:33 +08:00
|
|
|
- socket.rc == 0
|
|
|
|
- use_systemd
|
|
|
|
- osd_group_name in group_names
|
|
|
|
- is_after_hammer
|
2015-03-03 00:13:30 +08:00
|
|
|
|
|
|
|
- name: restart ceph osds on ubuntu
|
2016-03-29 21:37:31 +08:00
|
|
|
shell: |
|
|
|
|
for id in $(ls /var/lib/ceph/osd/ |grep -oh '[0-9]*'); do
|
|
|
|
initctl restart ceph-osd cluster={{ cluster }} id=$id
|
|
|
|
done
|
2015-06-26 06:26:03 +08:00
|
|
|
when:
|
2016-05-09 22:08:33 +08:00
|
|
|
- socket.rc == 0
|
|
|
|
- ansible_distribution == 'Ubuntu'
|
|
|
|
- not use_systemd
|
|
|
|
- osd_group_name in group_names
|
2015-03-03 00:13:30 +08:00
|
|
|
|
2015-07-01 00:07:03 +08:00
|
|
|
- name: restart ceph mdss on ubuntu
|
2016-03-29 21:37:31 +08:00
|
|
|
command: initctl restart ceph-mds cluster={{ cluster }} id={{ ansible_hostname }}
|
2015-07-01 00:07:03 +08:00
|
|
|
when:
|
2016-05-09 22:08:33 +08:00
|
|
|
- socket.rc == 0
|
|
|
|
- ansible_distribution == 'Ubuntu'
|
|
|
|
- not use_systemd
|
|
|
|
- mds_group_name in group_names
|
2015-07-01 00:07:03 +08:00
|
|
|
|
2015-03-03 00:13:30 +08:00
|
|
|
- name: restart ceph mdss
|
|
|
|
command: service ceph restart mds
|
2015-06-26 06:26:03 +08:00
|
|
|
when:
|
2016-05-09 22:08:33 +08:00
|
|
|
- socket.rc == 0
|
|
|
|
- ansible_distribution != 'Ubuntu'
|
|
|
|
- use_systemd
|
|
|
|
- mds_group_name in group_names
|
2016-05-09 23:26:37 +08:00
|
|
|
- is_before_infernalis
|
2015-11-21 05:34:29 +08:00
|
|
|
|
|
|
|
- name: restart ceph mdss with systemd
|
|
|
|
service:
|
2016-03-03 18:03:03 +08:00
|
|
|
name: ceph-mds@{{ mds_name }}
|
2015-11-21 05:34:29 +08:00
|
|
|
state: restarted
|
|
|
|
when:
|
2016-05-09 22:08:33 +08:00
|
|
|
- socket.rc == 0
|
|
|
|
- use_systemd
|
|
|
|
- mds_group_name in group_names
|
|
|
|
- is_after_hammer
|
2015-03-03 00:13:30 +08:00
|
|
|
|
2015-07-01 00:07:03 +08:00
|
|
|
- name: restart ceph rgws on ubuntu
|
2016-03-29 21:37:31 +08:00
|
|
|
command: initctl restart radosgw cluster={{ cluster }} id=rgw.{{ ansible_hostname }}
|
2015-07-01 00:07:03 +08:00
|
|
|
when:
|
2016-05-09 22:08:33 +08:00
|
|
|
- socketrgw.rc == 0
|
|
|
|
- ansible_distribution == 'Ubuntu'
|
|
|
|
- not use_systemd
|
|
|
|
- rgw_group_name in group_names
|
2015-07-01 00:07:03 +08:00
|
|
|
|
2015-03-03 00:13:30 +08:00
|
|
|
- name: restart ceph rgws
|
|
|
|
command: /etc/init.d/radosgw restart
|
2015-06-26 06:26:03 +08:00
|
|
|
when:
|
2016-05-09 22:08:33 +08:00
|
|
|
- socketrgw.rc == 0
|
|
|
|
- ansible_distribution != 'Ubuntu'
|
|
|
|
- rgw_group_name in group_names
|
|
|
|
- is_before_infernalis
|
2015-07-01 00:07:03 +08:00
|
|
|
|
|
|
|
- name: restart ceph rgws on red hat
|
|
|
|
command: /etc/init.d/ceph-radosgw restart
|
|
|
|
when:
|
2016-05-09 22:08:33 +08:00
|
|
|
- socketrgw.rc == 0
|
|
|
|
- ansible_os_family == 'RedHat'
|
|
|
|
- rgw_group_name in group_names
|
|
|
|
- is_before_infernalis
|
2015-11-21 05:34:29 +08:00
|
|
|
|
|
|
|
- name: restart ceph rgws with systemd
|
|
|
|
service:
|
|
|
|
name: ceph-rgw@{{ ansible_hostname }}
|
|
|
|
state: restarted
|
|
|
|
when:
|
2016-05-09 22:08:33 +08:00
|
|
|
- socketrgw.rc == 0
|
|
|
|
- use_systemd
|
|
|
|
- rgw_group_name in group_names
|
|
|
|
- is_after_hammer
|
2015-08-03 23:39:57 +08:00
|
|
|
|
|
|
|
- name: restart apache2
|
2015-09-04 00:18:53 +08:00
|
|
|
service:
|
|
|
|
name: apache2
|
|
|
|
state: restarted
|
|
|
|
enabled: yes
|
2015-08-03 23:39:57 +08:00
|
|
|
when:
|
2016-05-09 22:08:33 +08:00
|
|
|
- ansible_os_family == 'Debian'
|
|
|
|
- rgw_group_name in group_names
|
2015-08-03 23:39:57 +08:00
|
|
|
|
|
|
|
- name: restart apache2
|
2015-09-04 00:18:53 +08:00
|
|
|
service:
|
|
|
|
name: httpd
|
|
|
|
state: restarted
|
|
|
|
enabled: yes
|
2015-08-03 23:39:57 +08:00
|
|
|
when:
|
2016-05-09 22:08:33 +08:00
|
|
|
- ansible_os_family == 'RedHat'
|
|
|
|
- rgw_group_name in group_names
|