From: cel@kernel.org
To: <kdevops@lists.linux.dev>
Cc: Chuck Lever <chuck.lever@oracle.com>
Subject: [RFC PATCH 4/4] terraform: Remove the terrraform update_ssh_config module
Date: Fri, 31 Jan 2025 15:19:32 -0500 [thread overview]
Message-ID: <20250131201932.449083-5-cel@kernel.org> (raw)
In-Reply-To: <20250131201932.449083-1-cel@kernel.org>
From: Chuck Lever <chuck.lever@oracle.com>
The add_ssh_hosts_terraform playbook has taken its place.
XXX: Need to add a public_ip_map output for all cloud providers
before removing the update_ssh_config terraform module.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
Makefile | 1 +
terraform/aws/output.tf | 25 ------------------------
terraform/aws/update_ssh_config.tf | 1 -
terraform/azure/update_ssh_config.tf | 1 -
terraform/gce/update_ssh_config.tf | 1 -
terraform/oci/update_ssh_config.tf | 1 -
terraform/openstack/update_ssh_config.tf | 1 -
terraform/update_ssh_config.tf | 17 ----------------
8 files changed, 1 insertion(+), 47 deletions(-)
delete mode 120000 terraform/aws/update_ssh_config.tf
delete mode 120000 terraform/azure/update_ssh_config.tf
delete mode 120000 terraform/gce/update_ssh_config.tf
delete mode 120000 terraform/oci/update_ssh_config.tf
delete mode 120000 terraform/openstack/update_ssh_config.tf
delete mode 100644 terraform/update_ssh_config.tf
diff --git a/Makefile b/Makefile
index a0441b2c7bb8..e0e5d8f962d2 100644
--- a/Makefile
+++ b/Makefile
@@ -252,6 +252,7 @@ mrproper:
$(Q)$(MAKE) -f scripts/build.Makefile $@
$(Q)rm -f $(KDEVOPS_DEPCHECK)
$(Q)rm -f terraform/*/terraform.tfvars
+ $(Q)rm -rf terraform/*/.terraform
$(Q)rm -f $(KDEVOPS_NODES)
$(Q)rm -f $(KDEVOPS_HOSTFILE) $(KDEVOPS_MRPROPER)
$(Q)rm -f .config .config.old extra_vars.yaml $(KCONFIG_YAMLCFG)
diff --git a/terraform/aws/output.tf b/terraform/aws/output.tf
index cb8cab4afcdd..83a85a388055 100644
--- a/terraform/aws/output.tf
+++ b/terraform/aws/output.tf
@@ -1,30 +1,5 @@
# All generic output goes here
-locals {
- ssh_key_i = format(
- " %s%s ",
- var.ssh_config_pubkey_file != "" ? "-i " : "",
- var.ssh_config_pubkey_file != "" ? replace(var.ssh_config_pubkey_file, ".pub", "") : "",
- )
-}
-
-data "null_data_source" "group_hostnames_and_ips" {
- count = local.kdevops_num_boxes
- inputs = {
- value = format(
- "%30s : ssh %s@%s %s ",
- element(var.kdevops_nodes, count.index),
- var.ssh_config_user,
- element(aws_eip.kdevops_eip.*.public_ip, count.index),
- local.ssh_key_i,
- )
- }
-}
-
-output "login_using" {
- value = data.null_data_source.group_hostnames_and_ips.*.outputs
-}
-
# Each provider's output.tf needs to define a public_ip_map. This
# map is used to build the Ansible controller's ssh configuration.
# Each map entry contains the node's hostname and public IP address.
diff --git a/terraform/aws/update_ssh_config.tf b/terraform/aws/update_ssh_config.tf
deleted file mode 120000
index 03cd77a65841..000000000000
--- a/terraform/aws/update_ssh_config.tf
+++ /dev/null
@@ -1 +0,0 @@
-../update_ssh_config.tf
\ No newline at end of file
diff --git a/terraform/azure/update_ssh_config.tf b/terraform/azure/update_ssh_config.tf
deleted file mode 120000
index 03cd77a65841..000000000000
--- a/terraform/azure/update_ssh_config.tf
+++ /dev/null
@@ -1 +0,0 @@
-../update_ssh_config.tf
\ No newline at end of file
diff --git a/terraform/gce/update_ssh_config.tf b/terraform/gce/update_ssh_config.tf
deleted file mode 120000
index 03cd77a65841..000000000000
--- a/terraform/gce/update_ssh_config.tf
+++ /dev/null
@@ -1 +0,0 @@
-../update_ssh_config.tf
\ No newline at end of file
diff --git a/terraform/oci/update_ssh_config.tf b/terraform/oci/update_ssh_config.tf
deleted file mode 120000
index 03cd77a65841..000000000000
--- a/terraform/oci/update_ssh_config.tf
+++ /dev/null
@@ -1 +0,0 @@
-../update_ssh_config.tf
\ No newline at end of file
diff --git a/terraform/openstack/update_ssh_config.tf b/terraform/openstack/update_ssh_config.tf
deleted file mode 120000
index 03cd77a65841..000000000000
--- a/terraform/openstack/update_ssh_config.tf
+++ /dev/null
@@ -1 +0,0 @@
-../update_ssh_config.tf
\ No newline at end of file
diff --git a/terraform/update_ssh_config.tf b/terraform/update_ssh_config.tf
deleted file mode 100644
index 03f0cbed424a..000000000000
--- a/terraform/update_ssh_config.tf
+++ /dev/null
@@ -1,17 +0,0 @@
-module "ssh_config_update_host_entries" {
- source = "linux-kdevops/add-host-ssh-config/kdevops"
- version = "3.0.0"
-
- ssh_config = var.ssh_config
- update_ssh_config_enable = var.ssh_config_update
- cmd = "update"
- shorthosts = join(",", slice(local.shorthosts, 0, local.kdevops_num_boxes))
- hostnames = join(",", slice(local.ipv4s, 0, local.kdevops_num_boxes))
- ports = "22"
- user = var.ssh_config_user == "" ? "" : var.ssh_config_user
- id = replace(var.ssh_config_pubkey_file, ".pub", "")
- strict = var.ssh_config_use_strict_settings ? "true" : ""
- use_backup = !var.ssh_config_backup || var.ssh_config == "/dev/null" ? "" : "true"
- backup_postfix = "kdevops"
- kexalgorithms = var.ssh_config_kexalgorithms == "" ? "" : var.ssh_config_kexalgorithms
-}
--
2.48.1
prev parent reply other threads:[~2025-01-31 20:19 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-31 20:19 [RFC PATCH 0/4] Replace terraform update_ssh_config module cel
2025-01-31 20:19 ` [RFC PATCH 1/4] guestfs: Rename the update_ssh_config_guestfs role cel
2025-01-31 20:19 ` [RFC PATCH 2/4] update_ssh_config: Add always-run ssh clean-up steps cel
2025-01-31 20:19 ` [RFC PATCH 3/4] terraform: Add ssh hosts to ~/.ssh/config_kdevops_{{ sha1sum }} cel
2025-01-31 20:19 ` cel [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250131201932.449083-5-cel@kernel.org \
--to=cel@kernel.org \
--cc=chuck.lever@oracle.com \
--cc=kdevops@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox