partitions.yml 639 Bytes
---
- hosts: new-host
  become: true
  tasks:
      - name: Create partiton
        parted:
          device: "{{ item.device }}"
          number: "{{ item.number }}"
          part_end: "{{ item.end }}"
          part_start: "{{ item.start }}"
          state: present
#          part_type: logical
        with_items:
          - { device: "/dev/vdd", number: "1", start:  "0%", end:  "100GiB" }
          - { device: "/dev/vdd", number: "2", start:  "101GiB", end: "200GiB" }
          - { device: "/dev/vdd", number: "3", start:  "201GiB", end: "250GiB" }
          - { device: "/dev/vdd", number: "4", start: "251GiB", end: "100%" }