2015-03-26 22:43:54 +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-mon@.service.d/"
|
|
|
|
when:
|
|
|
|
- ceph_mon_systemd_overrides is defined
|
|
|
|
- ansible_service_mgr == 'systemd'
|
|
|
|
|
|
|
|
- name: add ceph-mon systemd service overrides
|
|
|
|
config_template:
|
|
|
|
src: "ceph-mon.service.d-overrides.j2"
|
|
|
|
dest: "/etc/systemd/system/ceph-mon@.service.d/ceph-mon-systemd-overrides.conf"
|
|
|
|
config_overrides: "{{ ceph_mon_systemd_overrides | default({}) }}"
|
|
|
|
config_type: "ini"
|
|
|
|
when:
|
|
|
|
- ceph_mon_systemd_overrides is defined
|
|
|
|
- ansible_service_mgr == 'systemd'
|
|
|
|
|
2017-01-20 17:14:35 +08:00
|
|
|
- name: start the monitor service
|
2015-11-21 05:34:29 +08:00
|
|
|
service:
|
2016-06-09 21:35:57 +08:00
|
|
|
name: ceph-mon@{{ monitor_name }}
|
|
|
|
state: started
|
|
|
|
enabled: yes
|
2015-11-21 05:34:29 +08:00
|
|
|
changed_when: false
|
2017-03-29 11:11:04 +08:00
|
|
|
|
|
|
|
# NOTE: This patch only affects Kraken. This fixes a bug when the monitor service
|
|
|
|
# does not start automatically after a reboot. Fix proposed upstream: ceph/ceph#14226
|
|
|
|
- name: enable the ceph-mon.target service
|
|
|
|
systemd:
|
|
|
|
name: ceph-mon.target
|
|
|
|
enabled: yes
|
|
|
|
masked: no
|
|
|
|
changed_when: false
|