Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Select the workspace automatically #7

Open
wants to merge 1 commit into
base: cloudwatt
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions cloudwatt/test_snat_lbaas/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,21 @@
# export INVENTORY=hosts
# export COLORTERM=gnome-terminal

init:
switch:
terraform workspace select $$OS_REGION_NAME

init: switch
terraform init

apply:
terraform apply -parallelism=1 -var-file=$$(terraform workspace show).tfvars -auto-approve
apply: switch
terraform apply -parallelism=1 -var-file=$$OS_REGION_NAME.tfvars -auto-approve

inventory:
inventory: switch
. ./cloud_stack.rc; \
terraform-inventory -b $$(cat terraform.tfstate.d/$$(terraform workspace show)/terraform.tfstate | jq -r .modules[0].outputs.bastion_fip.value[0]) -u $$SSH_USER -k $$SSH_KEY -o $$INVENTORY
terraform-inventory -b $$(cat terraform.tfstate.d/$$OS_REGION_NAME/terraform.tfstate | jq -r .modules[0].outputs.bastion_fip.value[0]) -u $$SSH_USER -k $$SSH_KEY -o $$INVENTORY

destroy:
terraform destroy -parallelism=1 -var-file=$$(terraform workspace show).tfvars -force
destroy: switch
terraform destroy -parallelism=1 -var-file=$$OS_REGION_NAME.tfvars -force

check:
. ./cloud_stack.rc; \
Expand Down