Merge "Ansible module: fix partition_configdrive.sh file"

This commit is contained in:
Zuul 2019-04-11 16:07:25 +00:00 committed by Gerrit Code Review
commit e2e94e1307
2 changed files with 8 additions and 2 deletions

View File

@ -54,8 +54,9 @@ partprobe $DEVICE || true
# Check for preexisting partition for configdrive
EXISTING_PARTITION=`/sbin/blkid -l -o device $DEVICE -t LABEL=config-2`
if [ -z $EXISTING_PARTITION ]; then
# Check if it is GPT partition and needs to be re-sized
if [ `partprobe $DEVICE print 2>&1 | grep "fix the GPT to use all of the space"` ]; then
# Check if it is GPT partition. Relocate the end table header to the end of
# disk (does not hurt if not needed anyway). Create the configdrive part
if parted -s $DEVICE print 2>&1 | grep -iq 'gpt'; then
log "Fixing GPT to use all of the space on device $DEVICE"
sgdisk -e $DEVICE || fail "move backup GPT data structures to the end of ${DEVICE}"

View File

@ -0,0 +1,5 @@
---
fixes:
- |
Fixes deployment with the ``ansible`` deploy interface and instance images with GPT partition
table.