ceph-ansible/roles/ceph-osd/tasks/osd_fragment.yml

52 lines
1.1 KiB
YAML

---
- name: get osd path
shell: "df | grep {{ item }} | awk '{print $6}'"
with_items: devices
changed_when: false
failed_when: false
register: osd_path
- name: get osd id
command: cat {{ item.stdout }}/whoami
with_items: osd_path.results
changed_when: false
failed_when: false
register: osd_id
- name: create a ceph fragment and assemble directory
file:
path: "{{ item }}"
state: directory
owner: root
group: root
mode: 0644
with_items:
- /etc/ceph/ceph.d/
- /etc/ceph/ceph.d/osd_fragments
- name: create the osd fragment
template:
src: osd.conf.j2
dest: /etc/ceph/ceph.d/osd_fragments/osd.{{ item.stdout }}.conf
with_items: osd_id.results
- name: copy ceph.conf for assembling
command: cp /etc/ceph/ceph.conf /etc/ceph/ceph.d/
changed_when: false
- name: assemble osd sections
assemble:
src: /etc/ceph/ceph.d/osd_fragments/
dest: /etc/ceph/ceph.d/osd.conf
owner: root
group: root
mode: 0644
- name: assemble ceph conf and osd fragments
assemble:
src: /etc/ceph/ceph.d/
dest: /etc/ceph/ceph.conf
owner: root
group: root
mode: 0644