fix ansible-lint errors
This commit is contained in:
@@ -7,16 +7,16 @@
|
|||||||
- name: "Check if the disk file already exists"
|
- name: "Check if the disk file already exists"
|
||||||
ansible.builtin.stat:
|
ansible.builtin.stat:
|
||||||
path: /tmp/test_file
|
path: /tmp/test_file
|
||||||
register: disk_file
|
register: mkfs_disk_file
|
||||||
|
|
||||||
- name: "Create a file to act as a disk if it doesn't exist"
|
- 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
|
ansible.builtin.command: dd if=/dev/zero of=/tmp/test_file bs=1000000 count=100
|
||||||
when: not disk_file.stat.exists
|
when: not mkfs_disk_file.stat.exists
|
||||||
register: dd_output
|
register: mkfs_dd_output
|
||||||
changed_when: dd_output.rc != 0
|
changed_when: mkfs_dd_output.rc != 0
|
||||||
|
|
||||||
roles:
|
roles:
|
||||||
- role: genlab.mkfs
|
- role: genlab.common.mkfs
|
||||||
mkfs_device: "/tmp/test_file"
|
mkfs_device: "/tmp/test_file"
|
||||||
mkfs_type: ext3
|
mkfs_type: ext3
|
||||||
mkfs_state: present
|
mkfs_state: present
|
||||||
|
|||||||
@@ -7,19 +7,19 @@
|
|||||||
tasks:
|
tasks:
|
||||||
- name: "Attach the file to a loop device"
|
- name: "Attach the file to a loop device"
|
||||||
ansible.builtin.command: losetup /dev/loop3 /tmp/test_file
|
ansible.builtin.command: losetup /dev/loop3 /tmp/test_file
|
||||||
register: loop_device
|
register: mkfs_loop_device
|
||||||
changed_when: loop_device.rc != 0
|
changed_when: mkfs_loop_device.rc != 0
|
||||||
|
|
||||||
- name: "Verify the filesystem type"
|
- name: "Verify the filesystem type"
|
||||||
ansible.builtin.command: blkid /dev/loop3
|
ansible.builtin.command: blkid /dev/loop3
|
||||||
register: blkid_output
|
register: mkfs_blkid_output
|
||||||
changed_when: blkid_output.rc != 0
|
changed_when: mkfs_blkid_output.rc != 0
|
||||||
|
|
||||||
- name: "Ensure filesystem is ext3"
|
- name: "Ensure filesystem is ext3"
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that:
|
that:
|
||||||
- "'TYPE=\"ext3\"' in blkid_output.stdout"
|
- "'TYPE=\"ext3\"' in mkfs_blkid_output.stdout"
|
||||||
|
|
||||||
- name: "Explore stdout"
|
- name: "Explore stdout"
|
||||||
ansible.builtin.debug:
|
ansible.builtin.debug:
|
||||||
var: blkid_output.stdout
|
var: mkfs_blkid_output.stdout
|
||||||
|
|||||||
Reference in New Issue
Block a user