---
- hosts: all
  tasks:
  - name: Creating swap partition
    parted:
      device: /dev/sda
      number: 1
      state: present
      part_start: 0
      part_end: 2GiB
  - name: Creating root partition
    parted:
      device: /dev/sda
      number: 2
      state: present
      part_start: 2GiB
      part_end: 30GiB
  - name: Creating var partition
    parted:
      device: /dev/sda
      number: 3
      state: present
      part_start: 30GiB
      part_end: 100%
  - name: Make swap partition
    command: "mkswap /dev/sda1"
  - name: Activate swap partition
    command: "swapon -a"
  - name: Create a xfs filesystem for root (/dev/sda2)
    filesystem:
      fstype: xfs
      dev: /dev/sda2
  - name: Create a xfs filesystem for var (/dev/sda3)
    filesystem:
      fstype: xfs
      dev: /dev/sda3




---
- hosts: all
  tasks:
  - name: Creating swap partition
    parted:
      device: /dev/sda
      number: 1
      state: present
      part_start: 0GiB
      part_end: 2GiB
  - name: Creating root partition
    parted:
      device: /dev/sda
      number: 2
      state: present
      part_start: 2GiB
      part_end: 30GiB
  - name: Creating var partition
    parted:
      device: /dev/sda
      number: 3
      state: present
      part_start: 30GiB
      part_end: 100%
  - name: Make swap partition
    command: "mkswap /dev/sda1"
  - name: Activate swap partition
    command: "swapon -a"
  - name: Create a xfs filesystem for root (/dev/sda2)
    filesystem:
      fstype: xfs
      dev: /dev/sda2
  - name: Create a xfs filesystem for var (/dev/sda3)
    filesystem:
      fstype: xfs
      dev: /dev/sda3




Fix start of swap partition
Fix start of swap partition
