---
- name: Create VG and LVOL for shrink_lv testing
  hosts: all
  become: true
  gather_facts: true

  vars:
    __vg_name   : test-vg
    __lv_name   : test-lv
    __lv_size   : 18g
    __lv_mount  : "/data/{{ __lv_name }}"
    __lv_fstype : ext4
    __part_size : 20GB
    __partition_devices:
      - /dev/sdb
      - /dev/sdc
      - /dev/sdd
      - /dev/sde
      - /dev/sdf
      - /dev/sdg
      - /dev/sdh
      - /dev/sdi
      - /dev/sdj
      - /dev/sdk
      - /dev/sdl
      - /dev/sdm
      - /dev/sdn
      - /dev/sdo
      - /dev/sdp
      - /dev/sdq
      - /dev/sdr
      - /dev/sds
      - /dev/sdt
      - /dev/sdu
      - /dev/sdv
      - /dev/sdw
      - /dev/sdx
      - /dev/sdy
      - /dev/sdz
      - /dev/vda
      - /dev/vdb
      - /dev/vdc
      - /dev/vdd
      - /dev/vde
      - /dev/vdf
      - /dev/vdg
      - /dev/vdh
      - /dev/vdi
      - /dev/vdj
      - /dev/vdk
      - /dev/vdl
      - /dev/vdm
      - /dev/vdn
      - /dev/vdo
      - /dev/sdaa
      - /dev/sdab
      - /dev/sdac
      - /dev/sdad
      - /dev/sdae

  tasks:
    - name: Debug __partition_devices
      ansible.builtin.debug:
        msg:
          - "{{ __partition_devices }}"
          - "{{ __partition_devices | join(',') }}"
          - "{{ __partition_devices | \
                map('regex_replace', '(?P<device>sd.*)', '\\g<device>' + '1', multiline=True) }}"
        verbosity: 1

    - name: Install LVM2
      ansible.builtin.package:
        name  : lvm2
        state : present

    - name: Include LVM setup creation tasks
      ansible.builtin.include_tasks: tasks/create_lvm_setup.yml
      loop: "{{ __partition_devices }}"

...
