Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ cephadm_public_network: "{{ storage_net_cidr }}"
cephadm_cluster_network: "{{ storage_mgmt_net_cidr }}"
# OSDs
cephadm_osd_devices: []
cephadm_osd_spec: []
7 changes: 0 additions & 7 deletions tasks/bootstrap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,5 @@
become: true
when: cephadm_install_ceph_cli

- name: Add OSDs
command:
cmd: "cephadm daemon add osd {{ ansible_hostname }}:{{ item }}"
become: true
when: cephadm_osd_devices | length > 0
with_items: "{{ cephadm_osd_devices }}"

delegate_to: "{{ groups['mons'][0] }}"
run_once: True
33 changes: 25 additions & 8 deletions tasks/osds.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,27 @@
---
- name: Add OSDs
vars:
ansible_host: "{{ hostvars[cephadm_host].ansible_host | default(cephadm_host) }}"
command:
cmd: "cephadm shell -- ceph orch daemon add osd {{ inventory_hostname }}:{{ item }}"
become: true
when: cephadm_osd_devices | length > 0
with_items: "{{ cephadm_osd_devices }}"
delegate_to: "{{ cephadm_host }}"
block:
- name: Add OSDs individually
command:
cmd: "cephadm daemon add osd {{ ansible_hostname }}:{{ item }}"
become: true
when: cephadm_osd_devices | length > 0
with_items: "{{ cephadm_osd_devices }}"

- name: Template out osd_spec.yml
copy:
content: "{{ cephadm_osd_spec | to_nice_yaml(indent=2) }}"
dest: "/var/run/ceph/{{ cephadm_fsid }}/osd_spec.yml"
when: cephadm_osd_spec | length > 0
become: true

- name: Apply OSDs spec
command:
cmd: >
cephadm shell --
ceph orch apply osd -i /var/run/ceph/osd_spec.yml
when: cephadm_osd_spec | length > 0
become: true

delegate_to: "{{ groups['mons'][0] }}"
run_once: True