0

I had increase disk space with the help of ansible playbook and now I have to resize the disk partition but its not working in Hetzner cloud server but it is working fine with other cloud servers.

Task used in the playbook:

- name: 'Partition resize'
  tags: ['fs-ext4']
  shell:
    cmd: >
      sgdisk -e {{ device | d( device_names[demo[test]]["device"] ) }} &&
      parted -m -s -a opt {{ device | d( device_names[demo[test]]["device"] ) }} resizepart 1 100%

I had to manually run growpart /dev/sdb 1 and resize2fs /dev/sdb1 in order to resize the partition. Below is the disk and partition.

sdb       201:10   0   12G  0 disk
└─sdb1    201:12   0   10G  0 part /test/demodata

How to fix the above task to automate this manual running commands.

007_programmer
  • 35
  • 1
  • 10

0 Answers0