|
@@ -1,6 +1,5 @@
|
|
|
#!/bin/bash
|
|
|
|
|
|
-set -o xtrace
|
|
|
set -e
|
|
|
|
|
|
if [ -z "$1" ]; then
|
|
@@ -23,23 +22,23 @@ if [ ! -f "$KEY_PATH" ]; then
|
|
|
fi
|
|
|
|
|
|
# # Deploy the CloudFormation template
|
|
|
-# echo -e "\n\n=========== Deploying single instance ==========="
|
|
|
-# aws cloudformation deploy \
|
|
|
-# --region $REGION \
|
|
|
-# --profile $CLI_PROFILE \
|
|
|
-# --stack-name $NEW_STACK_NAME \
|
|
|
-# --template-file single-instance.yml \
|
|
|
-# --no-fail-on-empty-changeset \
|
|
|
-# --capabilities CAPABILITY_NAMED_IAM \
|
|
|
-# --parameter-overrides \
|
|
|
-# EC2InstanceType=$DEFAULT_EC2_INSTANCE_TYPE \
|
|
|
-# KeyName=$AWS_KEY_PAIR_NAME \
|
|
|
-# EC2AMI=$EC2_AMI_ID
|
|
|
-
|
|
|
-# If the deploy succeeded, get the IP, create inventory and configure the created instances
|
|
|
+echo -e "\n\n=========== Deploying single instance ==========="
|
|
|
+aws cloudformation deploy \
|
|
|
+ --region $REGION \
|
|
|
+ --profile $CLI_PROFILE \
|
|
|
+ --stack-name $NEW_STACK_NAME \
|
|
|
+ --template-file single-instance.yml \
|
|
|
+ --no-fail-on-empty-changeset \
|
|
|
+ --capabilities CAPABILITY_NAMED_IAM \
|
|
|
+ --parameter-overrides \
|
|
|
+ EC2InstanceType=$DEFAULT_EC2_INSTANCE_TYPE \
|
|
|
+ KeyName=$AWS_KEY_PAIR_NAME \
|
|
|
+ EC2AMI=$EC2_AMI_ID
|
|
|
+
|
|
|
+# If the deploy succeeded, get the IP and configure the created instance
|
|
|
if [ $? -eq 0 ]; then
|
|
|
# Install additional Ansible roles from requirements
|
|
|
- # ansible-galaxy install -r requirements.yml
|
|
|
+ ansible-galaxy install -r requirements.yml
|
|
|
|
|
|
SERVER_IP=$(get_aws_export "PublicIp")
|
|
|
|