mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-30 16:41:21 -07:00
Initial commit
This commit is contained in:
commit
aebc1b03fd
4861 changed files with 812621 additions and 0 deletions
32
tests/integration/targets/filesystem/tasks/create_device.yml
Normal file
32
tests/integration/targets/filesystem/tasks/create_device.yml
Normal file
|
@ -0,0 +1,32 @@
|
|||
- name: 'Create a "disk" file'
|
||||
command: 'dd if=/dev/zero of={{ image_file }} bs=1M count={{ fssize }}'
|
||||
|
||||
- vars:
|
||||
dev: '{{ image_file }}'
|
||||
block:
|
||||
- when: fstype == 'lvm'
|
||||
block:
|
||||
- name: 'Create a loop device for LVM'
|
||||
command: 'losetup --show -f {{ dev }}'
|
||||
register: loop_device_cmd
|
||||
|
||||
- set_fact:
|
||||
dev: "{{ loop_device_cmd.stdout }}"
|
||||
|
||||
- include_tasks: '{{ action }}.yml'
|
||||
|
||||
always:
|
||||
- name: 'Detach loop device used for LVM'
|
||||
command: 'losetup -d {{ dev }}'
|
||||
args:
|
||||
removes: '{{ dev }}'
|
||||
when: fstype == 'lvm'
|
||||
|
||||
- name: 'Clean correct device for LVM'
|
||||
set_fact:
|
||||
dev: '{{ image_file }}'
|
||||
when: fstype == 'lvm'
|
||||
|
||||
- file:
|
||||
name: '{{ image_file }}'
|
||||
state: absent
|
Loading…
Add table
Add a link
Reference in a new issue