Migrate the genlab.mkfs role
This commit is contained in:
22
roles/mkfs/molecule/default/converge.yml
Normal file
22
roles/mkfs/molecule/default/converge.yml
Normal file
@@ -0,0 +1,22 @@
|
||||
---
|
||||
- name: Converge
|
||||
hosts: all
|
||||
|
||||
pre_tasks:
|
||||
|
||||
- name: "Check if the disk file already exists"
|
||||
ansible.builtin.stat:
|
||||
path: /tmp/test_file
|
||||
register: disk_file
|
||||
|
||||
- name: "Create a file to act as a disk if it doesn't exist"
|
||||
ansible.builtin.command: dd if=/dev/zero of=/tmp/test_file bs=1000000 count=100
|
||||
when: not disk_file.stat.exists
|
||||
register: dd_output
|
||||
changed_when: dd_output.rc != 0
|
||||
|
||||
roles:
|
||||
- role: genlab.mkfs
|
||||
mkfs_device: "/tmp/test_file"
|
||||
mkfs_type: ext3
|
||||
mkfs_state: present
|
||||
Reference in New Issue
Block a user