changes to packer command

This commit is contained in:
Edward Viaene
2017-10-20 10:55:18 +00:00
parent 8e3f1dd01a
commit 78653126bb
Regular → Executable
+2 -2
View File
@@ -1,5 +1,5 @@
#!/bin/bash
ARTIFACT=`packer build -machine-readable packer-example.json | awk -F, '$0 ~/artifact,0,id/ {print $6}'`
AMI_ID=`echo $ARTIFACT |cut -d ':' -f2`
packer build -machine-readable packer-example.json | tee build.log
AMI_ID=`egrep -m1 -oe 'ami-.{8}' build.log`
echo 'variable "AMI_ID" { default = "'${AMI_ID}'" }' > amivar.tf
terraform apply