ansible create/remove primary partion

---
 - hosts: all
   user: root
   become: yes
   become_method: sudo
   tasks:
        - name: Create a new primary partition
          parted:
            device: /dev/sdb
            number: 1
            state: present/absent
        - name: Create a new primary partition
          parted:
            device: /dev/sdc
            number: 1
            state: present/absent

Comments