ansible module to partition and format disk

Hi,

What are the ansible modules to partition and format (mkfs.ext4) disks?

Thank you.

  • j

i think you want the filesystem module

http://docs.ansible.com/filesystem_module.html

Thanks Brian, but I also want to partition the disk, the filesystem_module doesn’t seem able to do the partition, collect me if I am wrong.

no, it can just create filesystems. There are modules for lvm but
nothing for creating partitions from scratch (yet).

For you if you still need it and for new people that will land here, there is this parted module for Ansible awaiting pull request that does what you need: https://github.com/ansible/ansible-modules-extras/pull/2971