ceph-ansible/roles/ceph-common/handlers/main.yml

171 lines
4.7 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
(ceph_stable_release == 'dumpling' or
ceph_stable_release == 'emperor' or
ceph_stable_release == 'firefly' or
ceph_stable_release == 'giant' or
ceph_stable_release == 'hammer')
- name: restart ceph mons with systemd
service:
name: ceph-mon@{{ ansible_hostname }}
state: restarted
when:
socket.rc == 0 and
ansible_distribution != 'Ubuntu' and
mon_group_name in group_names and not
(ceph_stable_release == 'dumpling' or
ceph_stable_release == 'emperor' or
ceph_stable_release == 'firefly' or
ceph_stable_release == 'giant' or
ceph_stable_release == 'hammer')
- name: restart ceph mons on ubuntu
command: restart ceph-mon-all
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
(ceph_stable_release == 'dumpling' or
ceph_stable_release == 'emperor' or
ceph_stable_release == 'firefly' or
ceph_stable_release == 'giant' or
ceph_stable_release == 'hammer')
# 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 not
(ceph_stable_release == 'dumpling' or
ceph_stable_release == 'emperor' or
ceph_stable_release == 'firefly' or
ceph_stable_release == 'giant' or
ceph_stable_release == 'hammer')
- name: restart ceph osds on ubuntu
command: restart ceph-osd-all
when:
socket.rc == 0 and
ansible_distribution == 'Ubuntu' and
osd_group_name in group_names
- name: restart ceph mdss on ubuntu
command: restart ceph-mds-all
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_release == 'dumpling' or
ceph_stable_release == 'emperor' or
ceph_stable_release == 'firefly' or
ceph_stable_release == 'giant' or
ceph_stable_release == 'hammer')
- name: restart ceph mdss with systemd
service:
name: ceph-mds@{{ ansible_hostname }}
state: restarted
when:
socket.rc == 0 and
ansible_distribution != 'Ubuntu' and
mds_group_name in group_names and not
(ceph_stable_release == 'dumpling' or
ceph_stable_release == 'emperor' or
ceph_stable_release == 'firefly' or
ceph_stable_release == 'giant' or
ceph_stable_release == 'hammer')
- name: restart ceph rgws on ubuntu
command: restart ceph-all
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
(ceph_stable_release == 'dumpling' or
ceph_stable_release == 'emperor' or
ceph_stable_release == 'firefly' or
ceph_stable_release == 'giant' or
ceph_stable_release == 'hammer')
- 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
(ceph_stable_release == 'dumpling' or
ceph_stable_release == 'emperor' or
ceph_stable_release == 'firefly' or
ceph_stable_release == 'giant' or
ceph_stable_release == 'hammer')
- 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 not
(ceph_stable_release == 'dumpling' or
ceph_stable_release == 'emperor' or
ceph_stable_release == 'firefly' or
ceph_stable_release == 'giant' or
ceph_stable_release == 'hammer')
- 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