summaryrefslogtreecommitdiffstats
path: root/molecule/raspberrypi/prepare.yml
blob: 0d88f9d788ccc5efd37237e25769735885989aaa (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
---
- name: Prepare
  hosts: localhost
  gather_facts: true
  tasks:
    - name: "Create virtual disk image"
      become: true
      community.general.filesize:
        path: "/opt/vdd.img"
        size: 12G
        mode: "0755"

    - name: "Create test_device (loop block device)"
      become: true
      ansible.builtin.command:
        cmd: "losetup --show -Pf /opt/vdd.img"
      register: loop_device
      changed_when: true

    - name: "Format test device as ext4"
      become: true
      community.general.filesystem:
        fstype: "ext4"
        dev: "{{ loop_device.stdout }}"

    - name: "Show test info"
      ansible.builtin.debug:
        msg: "Test device: {{ loop_device.stdout }}"