From 34043eb344f6283a295626071edb46d76701c454 Mon Sep 17 00:00:00 2001 From: "tin.vo" Date: Fri, 20 Dec 2024 15:59:06 -0800 Subject: [PATCH] addressing comments --- .../modules/create/main.tf | 1 + .../modules/create/pki.tf | 7 ++-- .../modules/read/pki.tf | 32 +++---------------- 3 files changed, 10 insertions(+), 30 deletions(-) diff --git a/enos/modules/verify_secrets_engines/modules/create/main.tf b/enos/modules/verify_secrets_engines/modules/create/main.tf index 89ca1c80b406..424e1c948a7c 100644 --- a/enos/modules/verify_secrets_engines/modules/create/main.tf +++ b/enos/modules/verify_secrets_engines/modules/create/main.tf @@ -49,5 +49,6 @@ output "state" { auth = local.auth_output identity = local.identity_output kv = local.kv_output + pki = local.pki_output } } diff --git a/enos/modules/verify_secrets_engines/modules/create/pki.tf b/enos/modules/verify_secrets_engines/modules/create/pki.tf index f2755e330e7b..908d89855b3a 100644 --- a/enos/modules/verify_secrets_engines/modules/create/pki.tf +++ b/enos/modules/verify_secrets_engines/modules/create/pki.tf @@ -7,14 +7,15 @@ locals { pki_issuer_name = "issuer" pki_common_name = "common" pki_default_ttl = "72h" - pki_test_data_path_prefix = "smoke" pki_test_dir = "tmp-test-results" // Output pki_output = { - mount = local.pki_mount common_name = local.pki_common_name - test_results = local.pki_test_dir + issuer_name = local.pki_issuer_name + mount = local.pki_mount + ttl = local.pki_default_ttl + test_dir = local.pki_test_dir } } diff --git a/enos/modules/verify_secrets_engines/modules/read/pki.tf b/enos/modules/verify_secrets_engines/modules/read/pki.tf index b50627c03a86..acb0be79be0c 100644 --- a/enos/modules/verify_secrets_engines/modules/read/pki.tf +++ b/enos/modules/verify_secrets_engines/modules/read/pki.tf @@ -1,41 +1,19 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 -locals { - // Variables - pki_mount = "pki" # secret - pki_issuer_name = "issuer" - pki_common_name = "common" - pki_default_ttl = "72h" - pki_test_data_path_prefix = "smoke" - pki_test_dir = "tmp-test-results" - - // Output - pki_output = { - mount = local.pki_mount - common_name = local.pki_common_name - test_results = local.pki_test_dir - } - -} - -output "pki" { - value = local.pki_output -} - # Verify PKI Certificate resource "enos_remote_exec" "pki_verify_certificates" { for_each = var.hosts environment = { - MOUNT = local.pki_mount + MOUNT = var.create_state.pki.mount VAULT_ADDR = var.vault_addr VAULT_INSTALL_DIR = var.vault_install_dir VAULT_TOKEN = var.vault_root_token - COMMON_NAME = local.pki_common_name - ISSUER_NAME = local.pki_issuer_name - TTL = local.pki_default_ttl - TEST_DIR = local.pki_test_dir + COMMON_NAME = var.create_state.pki.common_name + ISSUER_NAME = var.create_state.pki.issuer_name + TTL = var.create_state.pki.ttl + TEST_DIR = var.create_state.pki.test_dir } scripts = [abspath("${path.module}/../../scripts/pki-verify-certificates.sh")]