mirror of
https://github.com/hashicorp/vault.git
synced 2026-01-06 17:21:36 +01:00
* license: update headers to IBM Corp. * `make proto` * update offset because source file changed Signed-off-by: Ryan Cragun <me@ryan.ec> Co-authored-by: Ryan Cragun <me@ryan.ec>
40 lines
885 B
HCL
40 lines
885 B
HCL
# Copyright IBM Corp. 2016, 2025
|
|
# SPDX-License-Identifier: BUSL-1.1
|
|
|
|
terraform {
|
|
required_providers {
|
|
# We need to specify the provider source in each module until we publish it
|
|
# to the public registry
|
|
enos = {
|
|
source = "registry.terraform.io/hashicorp-forge/enos"
|
|
version = ">= 0.4.0"
|
|
}
|
|
}
|
|
}
|
|
|
|
variable "service_name" {
|
|
type = string
|
|
description = "The Vault systemd service name"
|
|
default = "vault"
|
|
}
|
|
|
|
variable "hosts" {
|
|
description = "The target machines host addresses to use for the Vault cluster"
|
|
type = map(object({
|
|
ipv6 = string
|
|
private_ip = string
|
|
public_ip = string
|
|
}))
|
|
}
|
|
|
|
resource "enos_remote_exec" "shutdown_multiple_nodes" {
|
|
for_each = var.hosts
|
|
inline = ["sudo systemctl stop ${var.service_name}.service; sleep 5"]
|
|
|
|
transport = {
|
|
ssh = {
|
|
host = each.value.public_ip
|
|
}
|
|
}
|
|
}
|