2016-04-04 06:35:09 +08:00
|
|
|
---
|
2017-07-05 21:47:48 +08:00
|
|
|
- name: ensure systemd service override directory exists
|
|
|
|
file:
|
|
|
|
state: directory
|
|
|
|
path: "/etc/systemd/system/ceph-rbd-mirror@.service.d/"
|
|
|
|
when:
|
|
|
|
- ceph_rbd_mirror_systemd_overrides is defined
|
|
|
|
- ansible_service_mgr == 'systemd'
|
|
|
|
|
|
|
|
- name: add ceph-rbd-mirror systemd service overrides
|
|
|
|
config_template:
|
|
|
|
src: "ceph-rbd-mirror.service.d-overrides.j2"
|
|
|
|
dest: "/etc/systemd/system/ceph-rbd-mirror@.service.d/ceph-rbd-mirror-systemd-overrides.conf"
|
|
|
|
config_overrides: "{{ ceph_rbd_mirror_systemd_overrides | default({}) }}"
|
|
|
|
config_type: "ini"
|
|
|
|
when:
|
|
|
|
- ceph_rbd_mirror_systemd_overrides is defined
|
|
|
|
- ansible_service_mgr == 'systemd'
|
|
|
|
|
2017-01-20 17:14:35 +08:00
|
|
|
- name: start and add that the rbd mirror service to the init sequence
|
2016-04-04 06:35:09 +08:00
|
|
|
service:
|
2017-06-24 02:54:50 +08:00
|
|
|
name: "ceph-rbd-mirror@{{ ceph_rbd_mirror_local_user }}"
|
|
|
|
state: started
|
|
|
|
enabled: yes
|
2016-04-04 06:35:09 +08:00
|
|
|
changed_when: false
|
2017-09-15 06:48:53 +08:00
|
|
|
when:
|
2017-10-13 00:27:36 +08:00
|
|
|
- ceph_release_num[ceph_release] < ceph_release_num.luminous
|
2017-10-13 14:27:43 +08:00
|
|
|
|
2017-06-24 02:54:50 +08:00
|
|
|
- name: stop and remove the generic rbd-mirror service instance
|
|
|
|
service:
|
|
|
|
name: "ceph-rbd-mirror@{{ ceph_rbd_mirror_local_user }}"
|
|
|
|
state: stopped
|
|
|
|
enabled: no
|
|
|
|
changed_when: false
|
2017-09-15 06:48:53 +08:00
|
|
|
when:
|
2017-10-13 00:27:36 +08:00
|
|
|
- ceph_release_num[ceph_release] >= ceph_release_num.luminous
|
2017-06-24 02:54:50 +08:00
|
|
|
|
2017-09-26 20:12:11 +08:00
|
|
|
# This task is a workaround for rbd-mirror not starting after reboot
|
|
|
|
# The upstream fix is: https://github.com/ceph/ceph/pull/17969
|
|
|
|
# It's affecting, ceph version 12.2.0 (32ce2a3ae5239ee33d6150705cdb24d43bab910c) luminous (rc) and before
|
|
|
|
- name: enable ceph-rbd-mirror.target
|
2017-11-16 17:50:30 +08:00
|
|
|
systemd:
|
2017-09-26 20:12:11 +08:00
|
|
|
name: "ceph-rbd-mirror.target"
|
2017-11-16 17:50:30 +08:00
|
|
|
state: started
|
2017-09-26 20:12:11 +08:00
|
|
|
enabled: yes
|
|
|
|
changed_when: false
|
|
|
|
when:
|
2017-11-16 17:50:30 +08:00
|
|
|
- ceph_release_num[ceph_release] <= ceph_release_num.luminous
|
2017-09-26 20:12:11 +08:00
|
|
|
|
2017-06-24 02:54:50 +08:00
|
|
|
- name: start and add the rbd-mirror service instance
|
|
|
|
service:
|
|
|
|
name: "ceph-rbd-mirror@rbd-mirror.{{ ansible_hostname }}"
|
|
|
|
state: started
|
|
|
|
enabled: yes
|
|
|
|
changed_when: false
|
2017-09-15 06:48:53 +08:00
|
|
|
when:
|
2017-10-13 00:27:36 +08:00
|
|
|
- ceph_release_num[ceph_release] >= ceph_release_num.luminous
|