Skip to content

Commit

Permalink
allow for specifying stage via variables
Browse files Browse the repository at this point in the history
Signed-off-by: Jakub Sokołowski <jakub@status.im>
  • Loading branch information
jakubgs committed Nov 27, 2020
1 parent cb83a83 commit 79602fb
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ module "google-cloud" {
* `name` - Prefix of hostname before index. (default: `node`)
* `group` - Name of Ansible group to add hosts to.
* `env` - Environment for these hosts, affects DNS entries.
* `stage` - Name of stage, like `prod`, `dev`, or `staging`.
* `domain` - DNS Domain to update.
* __Security__
* `ansible_playbook` - Location of the Ansible playbook to run.
Expand Down
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* DERIVED --------------------------------------*/

locals {
stage = terraform.workspace
stage = var.stage != "" ? var.stage : terraform.workspace
dc = "${var.provider_name}-${var.zone}"
/* always add SSH, Tinc, Netdata, and Consul to allowed ports */
open_tcp_ports = concat(["22", "655", "8000", "8301"], var.open_tcp_ports)
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,12 @@ variable "env" {
type = string
}

variable "stage" {
description = "Name of stage, like prod, dev, or staging."
type = string
default = ""
}

variable "group" {
description = "Ansible group to assign hosts to."
type = string
Expand Down

0 comments on commit 79602fb

Please sign in to comment.