From 1f81cdbbc1e7e5f74d899c3d05620e055b75efda Mon Sep 17 00:00:00 2001 From: Matt Good Date: Fri, 7 Aug 2015 15:06:20 -0700 Subject: [PATCH 1/4] Fix "public_ips" output in "host.tf" Variable be "host" instead of "node". --- infra/host/host.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/infra/host/host.tf b/infra/host/host.tf index 7f40245..80e721b 100644 --- a/infra/host/host.tf +++ b/infra/host/host.tf @@ -58,7 +58,7 @@ resource "aws_instance" "host" { } output "public_ips" { - value = "${join(\",\", aws_instance.node.*.public_ip)}" + value = "${join(\",\", aws_instance.host.*.public_ip)}" } output "name" { From 9809b05502e20424a7ef74378c21e54ed4958472 Mon Sep 17 00:00:00 2001 From: Matt Good Date: Fri, 7 Aug 2015 15:08:01 -0700 Subject: [PATCH 2/4] Fix getting Terraform output vars in Gun Adds the base directory when calling cell-rundir to get the last run directory. --- module/cell.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/cell.bash b/module/cell.bash index a8568f2..62c4c70 100644 --- a/module/cell.bash +++ b/module/cell.bash @@ -38,7 +38,7 @@ user-ami() { cell-rundir() { if [[ ! "$cell_rundir" ]]; then mkdir -p "$GUN_ROOT/.gun/runs" - cell_rundir="$(ls -1Ut $GUN_ROOT/.gun/runs/ | grep "$GUN_PROFILE-" | head -n 1)" + cell_rundir="$GUN_ROOT/.gun/runs/$(ls -1Ut $GUN_ROOT/.gun/runs/ | grep "$GUN_PROFILE-" | head -n 1)" fi echo "${cell_rundir:?}" } From dc65d00112156761cabecad9f4d831d08ae98b58 Mon Sep 17 00:00:00 2001 From: Matt Good Date: Mon, 14 Sep 2015 18:25:54 -0700 Subject: [PATCH 3/4] Fix "bake" command Parsing the "aws" command output relied on configuring the tool for JSON output by default. Add "--output json" to force JSON output. --- module/cell.bash | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/module/cell.bash b/module/cell.bash index 62c4c70..aecfed6 100644 --- a/module/cell.bash +++ b/module/cell.bash @@ -28,7 +28,8 @@ coreos-ami() { user-ami() { declare region="$1" name="$2" - aws ec2 --region "$region" \ + aws --output json \ + ec2 --region "$region" \ describe-images \ --owners self \ --filters "Name=name,Values=$name" \ From c6cebe0c6bd29911364b72ad6388061dd8671ee0 Mon Sep 17 00:00:00 2001 From: Matt Good Date: Mon, 14 Sep 2015 18:26:33 -0700 Subject: [PATCH 4/4] Add "taint" subcommand for marking Terraform resources Calls "terraform taint" to mark a resource as "tainted" which will force recreating it on the next "apply". --- module/cell.bash | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/module/cell.bash b/module/cell.bash index aecfed6..b18e0d7 100644 --- a/module/cell.bash +++ b/module/cell.bash @@ -18,6 +18,7 @@ init() { cmd-export cell-plan plan cmd-export cell-destroy destroy cmd-export cell-output output + cmd-export cell-taint taint cmd-export cell-bake bake } @@ -90,6 +91,17 @@ cell-output() { popd > /dev/null } +cell-taint() { + declare name="$1" target="$2" + if [[ ! "$target" ]]; then + target=".cell" + fi + pushd "$(cell-rundir)/$target" > /dev/null + # XXX include additional options + terraform taint $name + popd > /dev/null +} + #cell-init() { # local stack_dir="$(dirname $BASH_SOURCE)/stack" # cp -r $stack_dir/* .