script improvements

This commit is contained in:
Edward Viaene
2017-11-03 19:44:02 +00:00
parent 9fe3f8aa1f
commit 4d1ea6279f
2 changed files with 11 additions and 0 deletions
@@ -1,2 +1,3 @@
#!/bin/sh
echo "the next command is not necessary anymore in newer versions of terraform. You should create a backend.tf file"
terraform remote config -backend=s3 -backend-config="bucket=terraform-state-a2b6219" -backend-config="key=terraform/terraform.tfstate" -backend-config="region=eu-west-1"
+10
View File
@@ -5,6 +5,16 @@ vgchange -ay
DEVICE_FS=`blkid -o value -s TYPE ${DEVICE}`
if [ "`echo -n $DEVICE_FS`" == "" ] ; then
# wait for the device to be attached
DEVICENAME=`echo "${DEVICE}" | awk -F '/' '{print $3}'`
DEVICEEXISTS=''
while [[ -z $DEVICEEXISTS ]]; do
echo "checking $DEVICENAME"
DEVICEEXISTS=`ls -asl /dev/disk/by-uuid/ | grep "$DEVICENAME"`
if [[ -z $DEVICEEXISTS ]]; then
sleep 15
fi
done
pvcreate ${DEVICE}
vgcreate data ${DEVICE}
lvcreate --name volume1 -l 100%FREE data