CI for the TripleO project
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

38 lines
1.1 KiB

---
- name: stat ceph_loop_device see if it already exists
stat:
path: "{{ ceph_loop_device }}"
register: dev_loop3_res
- name: log to syslog if ceph_loop_device exists
syslogger:
msg: "boostrap-subnodes - warning {{ ceph_loop_device }} already exists"
when: dev_loop3_res.stat.exists
- name: Make sure we have losetup installed/latest # noqa: package-latest
become: true
package:
name:
- util-linux
- lvm2
state: latest
- name: Use dd and losetup to create the loop devices
become: true
shell: |
dd if=/dev/zero of={{ item.0 }} bs=1 count=0 seek=14G
losetup {{ item.1 }} {{ item.0 }}
lsblk
changed_when: true
with_together:
- ["{{ ceph_loop_device_file }}", "{{ ceph_loop_device_file_legacy }}"]
- ["{{ ceph_loop_device }}", "{{ ceph_loop_device_legacy }}"]
- name: Use {pv,vg,lv}create to create logical volume on one loop device
become: true
shell: |
pvcreate {{ ceph_loop_device }}
vgcreate {{ ceph_logical_volume_group }} {{ ceph_loop_device }}
lvcreate -n {{ ceph_logical_volume_data }} -l +100%FREE {{ ceph_logical_volume_group }}
lvs
changed_when: true