566dae7b19
Adds a `nomad_acls` flag to our Terraform stack that bootstraps Nomad ACLs via a `local-exec` provider. There's no way to set the `NOMAD_TOKEN` in the Nomad TF provider if we're bootstrapping in the same Terraform stack, so instead of using `resource.nomad_acl_token`, we also bootstrap a wide-open anonymous policy. The resulting management token is exported as an environment var with `$(terraform output environment)` and tests that want stricter ACLs will be able to write them using that token. This should also provide a basis to do similar work with Consul ACLs in the future.
71 lines
1.7 KiB
HCL
71 lines
1.7 KiB
HCL
variable "platform" {
|
|
type = string
|
|
description = "Platform ID (ex. \"linux_amd64\" or \"windows_amd64\")"
|
|
default = "linux_amd64"
|
|
}
|
|
|
|
variable "nomad_version" {
|
|
type = string
|
|
description = "Nomad release version (ex. \"0.10.3\")"
|
|
default = ""
|
|
}
|
|
|
|
variable "nomad_sha" {
|
|
type = string
|
|
description = "Nomad build full SHA (ex. \"fef22bdbfa094b5d076710354275e360867261aa\")"
|
|
default = ""
|
|
}
|
|
|
|
variable "nomad_local_binary" {
|
|
type = string
|
|
description = "Path to local Nomad build (ex. \"/home/me/bin/nomad\")"
|
|
default = ""
|
|
}
|
|
|
|
variable "nomad_enterprise" {
|
|
type = bool
|
|
description = "If nomad_sha is used, deploy Nomad Enterprise"
|
|
default = false
|
|
}
|
|
|
|
variable "nomad_acls" {
|
|
type = bool
|
|
description = "Bootstrap ACLs"
|
|
default = false
|
|
}
|
|
|
|
variable "profile" {
|
|
type = string
|
|
description = "The name of the configuration profile (ex. 'full-cluster')"
|
|
default = ""
|
|
}
|
|
|
|
variable "role" {
|
|
type = string
|
|
description = "The role in the configuration profile for this instance (ex. 'client-linux')"
|
|
default = ""
|
|
}
|
|
|
|
variable "index" {
|
|
type = string # note that we have string here so we can default to ""
|
|
description = "The count of this instance for indexed configurations"
|
|
default = ""
|
|
}
|
|
|
|
variable "config_path" {
|
|
type = string
|
|
description = "The path to the config directory"
|
|
default = "../config"
|
|
}
|
|
|
|
variable "connection" {
|
|
type = object({
|
|
type = string
|
|
user = string
|
|
host = string
|
|
port = number
|
|
private_key = string
|
|
})
|
|
description = "ssh connection information for remote target"
|
|
}
|