mirror of https://github.com/ceph/ceph-ansible.git
commit
e78826eefb
|
@ -5,21 +5,37 @@
|
|||
changed_when: false
|
||||
failed_when: false
|
||||
register: osd_path
|
||||
when: not osd_directory
|
||||
|
||||
- name: get osd id
|
||||
command: cat {{ item.stdout }}/whoami
|
||||
with_items: osd_path.results
|
||||
changed_when: false
|
||||
failed_when: false
|
||||
register: osd_id
|
||||
register: osd_id_non_dir_scenario
|
||||
when: not osd_directory
|
||||
|
||||
- name: get osd id for directory scenario
|
||||
command: cat {{ item.stdout }}/whoami
|
||||
with_items: osd_directories
|
||||
changed_when: false
|
||||
failed_when: false
|
||||
register: osd_id_dir_scenario
|
||||
when: osd_directory
|
||||
|
||||
# NOTE (leseb): we must do this because of
|
||||
# https://github.com/ansible/ansible/issues/4297
|
||||
- name: combine osd_path results
|
||||
set_fact:
|
||||
combined_osd_id: "{{ osd_id_non_dir_scenario if not osd_directory else osd_id_dir_scenario }}"
|
||||
|
||||
- name: create a ceph fragment and assemble directory
|
||||
file:
|
||||
path: "{{ item }}"
|
||||
state: directory
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
owner: "{{ dir_owner }}"
|
||||
group: "{{ dir_group }}"
|
||||
mode: "{{ dir_mode }}"
|
||||
with_items:
|
||||
- /etc/ceph/ceph.d/
|
||||
- /etc/ceph/ceph.d/osd_fragments
|
||||
|
@ -28,7 +44,10 @@
|
|||
template:
|
||||
src: osd.conf.j2
|
||||
dest: /etc/ceph/ceph.d/osd_fragments/osd.{{ item.stdout }}.conf
|
||||
with_items: osd_id.results
|
||||
owner: "{{ dir_owner }}"
|
||||
group: "{{ dir_group }}"
|
||||
mode: "{{ activate_file_mode }}"
|
||||
with_items: combined_osd_id.results
|
||||
|
||||
- name: copy ceph.conf for assembling
|
||||
command: cp /etc/ceph/ceph.conf /etc/ceph/ceph.d/
|
||||
|
@ -38,14 +57,14 @@
|
|||
assemble:
|
||||
src: /etc/ceph/ceph.d/osd_fragments/
|
||||
dest: /etc/ceph/ceph.d/osd.conf
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
owner: "{{ dir_owner }}"
|
||||
group: "{{ dir_group }}"
|
||||
mode: "{{ activate_file_mode }}"
|
||||
|
||||
- name: assemble ceph conf and osd fragments
|
||||
assemble:
|
||||
src: /etc/ceph/ceph.d/
|
||||
dest: /etc/ceph/ceph.conf
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
owner: "{{ dir_owner }}"
|
||||
group: "{{ dir_group }}"
|
||||
mode: "{{ activate_file_mode }}"
|
||||
|
|
Loading…
Reference in New Issue