mirror of https://github.com/ceph/ceph-ansible.git
139 lines
3.5 KiB
YAML
139 lines
3.5 KiB
YAML
---
|
|
- name: update apt cache
|
|
apt:
|
|
update-cache: yes
|
|
|
|
- name: restart ceph mons
|
|
command: service ceph restart mon
|
|
when:
|
|
socket.rc == 0 and
|
|
ansible_distribution != 'Ubuntu' and
|
|
mon_group_name in group_names and not
|
|
is_ceph_infernalis
|
|
|
|
- name: restart ceph mons with systemd
|
|
service:
|
|
name: ceph-mon@{{ monitor_name }}
|
|
state: restarted
|
|
when:
|
|
socket.rc == 0 and
|
|
ansible_distribution != 'Ubuntu' and
|
|
mon_group_name in group_names and
|
|
is_ceph_infernalis
|
|
|
|
- name: restart ceph mons on ubuntu
|
|
command: initctl restart ceph-mon cluster={{ cluster }} id={{ monitor_name }}
|
|
when:
|
|
socket.rc == 0 and
|
|
ansible_distribution == 'Ubuntu' and
|
|
mon_group_name in group_names
|
|
|
|
- name: restart ceph osds
|
|
command: service ceph restart osd
|
|
when:
|
|
socket.rc == 0 and
|
|
ansible_distribution != 'Ubuntu' and
|
|
osd_group_name in group_names and
|
|
not is_ceph_infernalis
|
|
|
|
# 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:
|
|
socket.rc == 0 and
|
|
ansible_distribution != 'Ubuntu' and
|
|
osd_group_name in group_names and
|
|
is_ceph_infernalis
|
|
|
|
- name: restart ceph osds on ubuntu
|
|
shell: |
|
|
for id in $(ls /var/lib/ceph/osd/ |grep -oh '[0-9]*'); do
|
|
initctl restart ceph-osd cluster={{ cluster }} id=$id
|
|
done
|
|
when:
|
|
socket.rc == 0 and
|
|
ansible_distribution == 'Ubuntu' and
|
|
osd_group_name in group_names
|
|
|
|
- name: restart ceph mdss on ubuntu
|
|
command: initctl restart ceph-mds cluster={{ cluster }} id={{ ansible_hostname }}
|
|
when:
|
|
socket.rc == 0 and
|
|
ansible_distribution == 'Ubuntu' and
|
|
mds_group_name in group_names
|
|
|
|
- name: restart ceph mdss
|
|
command: service ceph restart mds
|
|
when:
|
|
socket.rc == 0 and
|
|
ansible_distribution != 'Ubuntu' and
|
|
mds_group_name in group_names and
|
|
ceph_stable and
|
|
ceph_stable_release in ceph_stable_releases
|
|
|
|
- name: restart ceph mdss with systemd
|
|
service:
|
|
name: ceph-mds@{{ mds_name }}
|
|
state: restarted
|
|
when:
|
|
socket.rc == 0 and
|
|
ansible_distribution != 'Ubuntu' and
|
|
mds_group_name in group_names and
|
|
ceph_stable and
|
|
ceph_stable_release not in ceph_stable_releases
|
|
|
|
- name: restart ceph rgws on ubuntu
|
|
command: initctl restart radosgw cluster={{ cluster }} id=rgw.{{ ansible_hostname }}
|
|
when:
|
|
socketrgw.rc == 0 and
|
|
ansible_distribution == 'Ubuntu' and
|
|
rgw_group_name in group_names
|
|
|
|
- name: restart ceph rgws
|
|
command: /etc/init.d/radosgw restart
|
|
when:
|
|
socketrgw.rc == 0 and
|
|
ansible_distribution != 'Ubuntu' and
|
|
rgw_group_name in group_names and
|
|
not is_ceph_infernalis
|
|
|
|
- name: restart ceph rgws on red hat
|
|
command: /etc/init.d/ceph-radosgw restart
|
|
when:
|
|
socketrgw.rc == 0 and
|
|
ansible_os_family == 'RedHat' and
|
|
rgw_group_name in group_names and
|
|
not is_ceph_infernalis
|
|
|
|
- name: restart ceph rgws with systemd
|
|
service:
|
|
name: ceph-rgw@{{ ansible_hostname }}
|
|
state: restarted
|
|
when:
|
|
socketrgw.rc == 0 and
|
|
ansible_distribution != 'Ubuntu' and
|
|
rgw_group_name in group_names and
|
|
is_ceph_infernalis
|
|
|
|
- name: restart apache2
|
|
service:
|
|
name: apache2
|
|
state: restarted
|
|
enabled: yes
|
|
when:
|
|
ansible_os_family == 'Debian' and
|
|
rgw_group_name in group_names
|
|
|
|
- name: restart apache2
|
|
service:
|
|
name: httpd
|
|
state: restarted
|
|
enabled: yes
|
|
when:
|
|
ansible_os_family == 'RedHat' and
|
|
rgw_group_name in group_names
|