2015-01-09 01:27:43 +08:00
|
|
|
---
|
2015-05-16 00:27:41 +08:00
|
|
|
- name: get OSD path
|
2015-01-09 01:27:43 +08:00
|
|
|
shell: "df | grep {{ item }} | awk '{print $6}'"
|
|
|
|
with_items: devices
|
|
|
|
register: osd_path
|
|
|
|
ignore_errors: true
|
2015-04-09 00:46:54 +08:00
|
|
|
changed_when: False
|
2015-01-09 01:27:43 +08:00
|
|
|
|
2015-05-16 00:27:41 +08:00
|
|
|
- name: get OSD id
|
2015-01-09 01:27:43 +08:00
|
|
|
command: cat {{ item.stdout }}/whoami
|
|
|
|
register: osd_id
|
|
|
|
with_items: osd_path.results
|
|
|
|
ignore_errors: true
|
2015-04-09 00:46:54 +08:00
|
|
|
changed_when: False
|
2015-01-09 01:27:43 +08:00
|
|
|
|
2015-05-16 00:27:41 +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-05-16 00:27:41 +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-04-09 00:46:54 +08:00
|
|
|
changed_when: False
|
2015-01-09 01:27:43 +08:00
|
|
|
|
2015-05-16 00:27:41 +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-05-16 00:27:41 +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
|