File tree Expand file tree Collapse file tree 3 files changed +26
-15
lines changed Expand file tree Collapse file tree 3 files changed +26
-15
lines changed Original file line number Diff line number Diff line change @@ -24,3 +24,4 @@ cephadm_public_network: "{{ storage_net_cidr }}"
24
24
cephadm_cluster_network : " {{ storage_mgmt_net_cidr }}"
25
25
# OSDs
26
26
cephadm_osd_devices : []
27
+ cephadm_osd_spec : []
Original file line number Diff line number Diff line change 64
64
become : true
65
65
when : cephadm_install_ceph_cli
66
66
67
- - name : Add OSDs
68
- command :
69
- cmd : " cephadm daemon add osd {{ ansible_hostname }}:{{ item }}"
70
- become : true
71
- when : cephadm_osd_devices | length > 0
72
- with_items : " {{ cephadm_osd_devices }}"
73
-
74
67
delegate_to : " {{ groups['mons'][0] }}"
75
68
run_once : True
Original file line number Diff line number Diff line change 1
1
---
2
2
- name : Add OSDs
3
- vars :
4
- ansible_host : " {{ hostvars[cephadm_host].ansible_host | default(cephadm_host) }}"
5
- command :
6
- cmd : " cephadm shell -- ceph orch daemon add osd {{ inventory_hostname }}:{{ item }}"
7
- become : true
8
- when : cephadm_osd_devices | length > 0
9
- with_items : " {{ cephadm_osd_devices }}"
10
- delegate_to : " {{ cephadm_host }}"
3
+ block :
4
+ - name : Add OSDs individually
5
+ command :
6
+ cmd : " cephadm daemon add osd {{ ansible_hostname }}:{{ item }}"
7
+ become : true
8
+ when : cephadm_osd_devices | length > 0
9
+ with_items : " {{ cephadm_osd_devices }}"
10
+
11
+ - name : Template out osd_spec.yml
12
+ copy :
13
+ content : " {{ cephadm_osd_spec | to_nice_yaml(indent=2) }}"
14
+ dest : " /var/run/ceph/{{ cephadm_fsid }}/osd_spec.yml"
15
+ when : cephadm_osd_spec | length > 0
16
+ become : true
17
+
18
+ - name : Apply OSDs spec
19
+ command :
20
+ cmd : >
21
+ cephadm shell --
22
+ ceph orch apply osd -i /var/run/ceph/osd_spec.yml
23
+ when : cephadm_osd_spec | length > 0
24
+ become : true
25
+
26
+ delegate_to : " {{ groups['mons'][0] }}"
27
+ run_once : True
You can’t perform that action at this time.
0 commit comments