The script can fail to get the osd id because the osds are activated by
udev and it can take a while for them to activate. This commit fixes
that by trying to get all the osds per node in a loop.
This commit also makes the osd services enabled so that they are
available after reboot.
Signed-off-by: Boris Ranto <branto@redhat.com>
failed_when: false
always_run: true
register: osd_id
+ until: osd_id.stdout_lines|length == devices|unique|length
+ retries: 10
- name: ensure systemd service override directory exists
file:
service:
name: ceph-osd@{{ item }}
state: started
+ enabled: true
with_items: "{{ (osd_id|default({})).stdout_lines|default([]) }}"
changed_when: false