mirror of
https://github.com/farcasclaudiu/terraform-course.git
synced 2026-06-22 09:01:59 +03:00
script improvements
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user