510cea0c23
- In case we deploy Ceph on a multi-node env we have to prepare the loop devices on all nodes. For this we moved loop devices setup to the deploy-env Ansible role. For simplicity we need the same device on all nodes, so we create a loop device with a big minor number (/dev/loop100 by default) hoping that only low minor numbers could be busy. - For test jobs we don't need to use different devices for OSD data and metadata. There is no any benefit from this for the test environment. So let's keep it simple and put both OSD data and metadata on the same device. - On multi-node env Ceph cluster needs cluster members see each other, so let's use pod network CIDR. Change-Id: I493b6c31d97ff2fc4992c6bb1994d0c73320cd7b
34 lines
810 B
YAML
34 lines
810 B
YAML
---
|
|
- name: Create loop device image
|
|
shell: |
|
|
mkdir -p {{ loopback_image | dirname }}
|
|
truncate -s {{ loopback_image_size }} {{ loopback_image }}
|
|
|
|
- name: Create loop device
|
|
shell: |
|
|
mknod {{ loopback_device }} b $(grep loop /proc/devices | cut -c3) {{ loopback_device | regex_search('[0-9]+') }}
|
|
|
|
- name: Create loop-setup systemd unit
|
|
template:
|
|
src: files/loop-setup.service
|
|
dest: /etc/systemd/system/loop-setup.service
|
|
notify:
|
|
- Systemd reload
|
|
|
|
- name: Systemd reload
|
|
shell: systemctl daemon-reload
|
|
|
|
- name: Configure loop-setup systemd unit
|
|
service:
|
|
name: loop-setup
|
|
enabled: yes
|
|
state: started
|
|
notify:
|
|
- Systemd reload
|
|
- Restart loop-setup
|
|
|
|
- name: Check {{ loopback_device }} is attached
|
|
shell: |
|
|
losetup | grep -i {{ loopback_device }}
|
|
...
|