On Monday, October 16, 2017 at 11:09:20 PM UTC-5, coach...@gmail.com wrote: > > Hi, > > I have a query here and request your help .I am trying to create multiple > partition on the disk with parted module , but it only creates one > partition. Is parted module creates only one partition of the entire disk > or is there is way to achieve this. > > - name: create of partitions > parted: "label=gpt device=/dev/sdb state=present number=2 unit=MiB > part_end=1GiB" > > when try to create on more partition on the disk gives the below error. > > [student@puppetclient ~]$ ansible 192.168.3.157 -m parted -a > "device=/dev/sdb number=3 state=present part_end=1GB" > 192.168.3.157 | FAILED! => { > "changed": false, > "err": "Error: You requested a partition from 0.00kiB to 976563kiB > (sectors 0..1953125).\nThe closest location we can manage is 17.0kiB to > 1024kiB (sectors 34..2047).\n", > "failed": true, > "msg": "Error while running parted script: /sbin/parted -s -m -a > optimal /dev/sdb -- unit KiB mkpart primary 0% 1GB", > "out": "", > "rc": 1 > > > Thank you for looking into it. >
Haven't found much on Google about creating multiple partitions. You will have to workout the disk dimensions, but this worked for me: --- - name: Create partition 1 parted: device: /dev/xvdb number: 1 state: present part_end: 1GiB - parted: device: /dev/xvdb number: 2 state: present part_start: 1GiB part_end: 31GiB - parted: device: /dev/xvdb number: 3 state: present part_start: 31GiB part_end: 61GiB - parted: device: /dev/xvdb number: 4 state: present part_start: 61GiB part_end: 101GiB - parted: device: /dev/xvdb number: 5 state: present part_start: 101GiB part_end: 111GiB - parted: device: /dev/xvdb number: 6 state: present part_start: 111GiB part_end: 100% -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscr...@googlegroups.com. To post to this group, send email to ansible-project@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/c814349e-3605-4f22-ab89-70537791ad07%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.