2015-01-09 01:27:43 +08:00
|
|
|
---
|
2015-07-24 02:01:43 +08:00
|
|
|
- name: get osd path
|
2015-01-09 01:27:43 +08:00
|
|
|
shell: "df | grep {{ item }} | awk '{print $6}'"
|
|
|
|
with_items: devices
|
2015-06-26 06:26:03 +08:00
|
|
|
changed_when: false
|
2015-07-29 00:21:15 +08:00
|
|
|
failed_when: false
|
2015-06-26 06:26:03 +08:00
|
|
|
register: osd_path
|
2015-01-09 01:27:43 +08:00
|
|
|
|
2015-07-24 02:01:43 +08:00
|
|
|
- name: get osd id
|
2015-01-09 01:27:43 +08:00
|
|
|
command: cat {{ item.stdout }}/whoami
|
|
|
|
with_items: osd_path.results
|
2015-06-26 06:26:03 +08:00
|
|
|
changed_when: false
|
2015-07-29 00:21:15 +08:00
|
|
|
failed_when: false
|
2015-06-26 06:26:03 +08:00
|
|
|
register: osd_id
|
2015-01-09 01:27:43 +08:00
|
|
|
|
2015-07-24 02:01:43 +08:00
|
|
|
- name: create a ceph fragment and assemble directory
|
2015-01-09 01:27:43 +08:00
|
|
|
file: >
|
|
|
|
path={{ item }}
|
|
|
|
state=directory
|
|
|
|
owner=root
|
|
|
|
group=root
|
|
|
|
mode=0644
|
|
|
|
with_items:
|
|
|
|
- /etc/ceph/ceph.d/
|
|
|
|
- /etc/ceph/ceph.d/osd_fragments
|
|
|
|
|
2015-07-24 02:01:43 +08:00
|
|
|
- name: create the osd fragment
|
2015-01-09 01:27:43 +08:00
|
|
|
template: >
|
|
|
|
src=osd.conf.j2
|
|
|
|
dest=/etc/ceph/ceph.d/osd_fragments/osd.{{ item.stdout }}.conf
|
|
|
|
with_items: osd_id.results
|
|
|
|
|
2015-05-16 00:27:41 +08:00
|
|
|
- name: copy ceph.conf for assembling
|
2015-01-09 01:27:43 +08:00
|
|
|
command: cp /etc/ceph/ceph.conf /etc/ceph/ceph.d/
|
2015-06-26 06:26:03 +08:00
|
|
|
changed_when: false
|
2015-01-09 01:27:43 +08:00
|
|
|
|
2015-07-24 02:01:43 +08:00
|
|
|
- name: assemble osd sections
|
2015-01-09 01:27:43 +08:00
|
|
|
assemble: >
|
|
|
|
src=/etc/ceph/ceph.d/osd_fragments/
|
|
|
|
dest=/etc/ceph/ceph.d/osd.conf
|
|
|
|
owner=root
|
|
|
|
group=root
|
|
|
|
mode=0644
|
|
|
|
|
2015-07-24 02:01:43 +08:00
|
|
|
- name: assemble ceph conf and osd fragments
|
2015-01-09 01:27:43 +08:00
|
|
|
assemble: >
|
|
|
|
src=/etc/ceph/ceph.d/
|
|
|
|
dest=/etc/ceph/ceph.conf
|
|
|
|
owner=root
|
|
|
|
group=root
|
|
|
|
mode=0644
|