2017-07-26 05:48:13 +08:00
|
|
|
---
|
|
|
|
- include: osd_fragment.yml
|
|
|
|
when: crush_location
|
|
|
|
|
|
|
|
- name: get osd id
|
|
|
|
shell: |
|
|
|
|
ls /var/lib/ceph/osd/ | sed 's/.*-//'
|
|
|
|
changed_when: false
|
|
|
|
failed_when: false
|
|
|
|
always_run: true
|
|
|
|
register: osd_id
|
|
|
|
|
2017-07-05 21:47:48 +08:00
|
|
|
- name: ensure systemd service override directory exists
|
|
|
|
file:
|
|
|
|
state: directory
|
|
|
|
path: "/etc/systemd/system/ceph-osd@.service.d/"
|
|
|
|
when:
|
|
|
|
- ceph_osd_systemd_overrides is defined
|
|
|
|
- ansible_service_mgr == 'systemd'
|
|
|
|
|
|
|
|
- name: add ceph-osd systemd service overrides
|
|
|
|
config_template:
|
|
|
|
src: "ceph-osd.service.d-overrides.j2"
|
|
|
|
dest: "/etc/systemd/system/ceph-osd@.service.d/ceph-osd-systemd-overrides.conf"
|
|
|
|
config_overrides: "{{ ceph_osd_systemd_overrides | default({}) }}"
|
|
|
|
config_type: "ini"
|
|
|
|
when:
|
|
|
|
- ceph_osd_systemd_overrides is defined
|
|
|
|
- ansible_service_mgr == 'systemd'
|
|
|
|
|
2017-08-03 23:08:34 +08:00
|
|
|
- name: ensure osd daemons are started
|
2017-07-26 05:48:13 +08:00
|
|
|
service:
|
|
|
|
name: ceph-osd@{{ item }}
|
|
|
|
state: started
|
|
|
|
with_items: "{{ (osd_id|default({})).stdout_lines|default([]) }}"
|
|
|
|
changed_when: false
|