When I run this on the command line it works fine:
echo -e "n\np\n1\n\n\nw" | sudo fdisk /dev/sdb
But in Ansible it does not want to run in shell:
- name: partition new disk
shell: echo -e "n\np\n1\n\n\nw" | sudo fdisk /dev/sdb
It does not come back with an error, but it does not create the partition either.
I checked that Ansible and LVM will not do what I need.
Any advice?