Ryan Cragun 27ab988205
[QT-695] Add config_mode variant to some scenarios (#26380)
Add `config_mode` variant to some scenarios so we can dynamically change
how we primarily configure the Vault cluster, either by a configuration
file or with environment variables.

As part of this change we also:
* Start consuming the Enos terraform provider from public Terraform
  registry.
* Remove the old `seal_ha_beta` variant as it is no longer required.
* Add a module that performs a `vault operator step-down` so that we can
  force leader elections in scenarios.
* Wire up an operator step-down into some scenarios to test both the old
  and new multiseal code paths during leader elections.

Signed-off-by: Ryan Cragun <me@ryan.ec>
2024-04-22 12:34:47 -06:00

59 lines
1.3 KiB
HCL

# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: BUSL-1.1
terraform {
required_providers {
enos = {
source = "registry.terraform.io/hashicorp-forge/enos"
}
}
}
resource "enos_local_exec" "get_build_date" {
scripts = [abspath("${path.module}/scripts/build_date.sh")]
}
resource "enos_local_exec" "get_revision" {
inline = ["git rev-parse HEAD"]
}
resource "enos_local_exec" "get_version" {
inline = ["${abspath("${path.module}/scripts/version.sh")} version"]
}
resource "enos_local_exec" "get_version_base" {
inline = ["${abspath("${path.module}/scripts/version.sh")} version-base"]
}
resource "enos_local_exec" "get_version_pre" {
inline = ["${abspath("${path.module}/scripts/version.sh")} version-pre"]
}
resource "enos_local_exec" "get_version_meta" {
inline = ["${abspath("${path.module}/scripts/version.sh")} version-meta"]
}
output "build_date" {
value = trimspace(enos_local_exec.get_build_date.stdout)
}
output "revision" {
value = trimspace(enos_local_exec.get_revision.stdout)
}
output "version" {
value = trimspace(enos_local_exec.get_version.stdout)
}
output "version_base" {
value = trimspace(enos_local_exec.get_version_base.stdout)
}
output "version_pre" {
value = trimspace(enos_local_exec.get_version_pre.stdout)
}
output "version_meta" {
value = trimspace(enos_local_exec.get_version_meta.stdout)
}