Welcome to the Linux Foundation Forum!

Ansible roles - Parted


I am struggling to find any information on creating a Physical volume using parted in a role. I can in a playbook but roles always fail with an error code as below:

fatal: [server3.example.com]: FAILED! => {"changed": false, "err": "/sbin/parted: invalid token: [lvol]\n", "msg": "Error while running parted script: /sbin/parted -s -m -a optimal /dev/sdb -- unit KiB set 1 [lvol] on", "out": "", "rc": 1}

The line in the task is as follows:

  • parted: device=/dev/sdb number=1 label=msdos flags=[lvol] state=present

Please can someone let me know what I am doing wrong.



Upcoming Training