From: cel@kernel.org
To: <kdevops@lists.linux.dev>
Cc: Chuck Lever <chuck.lever@oracle.com>
Subject: [PATCH v2 12/12] terraform: Remove the terrraform update_ssh_config module
Date: Wed, 5 Feb 2025 10:52:52 -0500 [thread overview]
Message-ID: <20250205155252.1317763-13-cel@kernel.org> (raw)
In-Reply-To: <20250205155252.1317763-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>
---
terraform/aws/output.tf | 25 ----------------------
terraform/aws/update_ssh_config.tf | 1 -
terraform/azure/output.tf | 18 ----------------
terraform/azure/update_ssh_config.tf | 1 -
terraform/gce/output.tf | 27 +-----------------------
terraform/gce/update_ssh_config.tf | 1 -
terraform/oci/update_ssh_config.tf | 1 -
terraform/openstack/output.tf | 2 ++
terraform/openstack/update_ssh_config.tf | 1 -
terraform/update_ssh_config.tf | 17 ---------------
10 files changed, 3 insertions(+), 91 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/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/output.tf b/terraform/azure/output.tf
index a8e32b605a47..ce5ac79ff694 100644
--- a/terraform/azure/output.tf
+++ b/terraform/azure/output.tf
@@ -20,24 +20,6 @@ output "kdevops_public_ip_addresses" {
value = data.azurerm_public_ip.public_ips.*.ip_address
}
-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 = {
- # In theory using "${self.triggers["name"]}" and "${self.triggersp["ip"]}"
- # would be nice but it is not supported in this context, only in the
- # provisioner and connection contexts.
- value = "${format("%30s : ssh %s@%s %s ", element(azurerm_linux_virtual_machine.kdevops_vm.*.name, count.index), var.ssh_config_user, element(azurerm_public_ip.kdevops_publicip.*.ip_address, 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/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/output.tf b/terraform/gce/output.tf
index b95667cc7efd..470617f700ee 100644
--- a/terraform/gce/output.tf
+++ b/terraform/gce/output.tf
@@ -1,29 +1,4 @@
-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", "") : "")
- network_interfaces = google_compute_instance.kdevops_instances.*.network_interface
- access_configs = [
- for net_interface in local.network_interfaces :
- net_interface[0].access_config
- ]
- ipv4s = [
- for access_config in local.access_configs :
- access_config[0].nat_ip
- ]
-}
-
-data "null_data_source" "group_hostnames_and_ips" {
- count = local.kdevops_num_boxes
- inputs = {
- # In theory using "${self.triggers["name"]}" and "${self.triggersp["ip"]}"
- # would be nice but it is not supported in this context, only in the
- # provisioner and connection contexts.
- value = "${format("%30s : ssh %s@%s %s ", element(google_compute_instance.kdevops_instances.*.name, count.index), var.ssh_config_user, element(local.ipv4s, count.index), local.ssh_key_i)}"
- }
-}
-
-output "login_using" {
- value = data.null_data_source.group_hostnames_and_ips.*.outputs
-}
+# All generic output goes here
# Each provider's output.tf needs to define a public_ip_map. This
# map is used to build the Ansible controller's ssh configuration.
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/output.tf b/terraform/openstack/output.tf
index aff44d1b45f9..2d60cc46c030 100644
--- a/terraform/openstack/output.tf
+++ b/terraform/openstack/output.tf
@@ -1,3 +1,5 @@
+# All generic output goes here
+
data "null_data_source" "group_hostnames_and_ips" {
count = local.kdevops_num_boxes
inputs = {
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
next prev parent reply other threads:[~2025-02-05 15:53 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-05 15:52 [PATCH v2 00/12] Replace terraform update_ssh_config module cel
2025-02-05 15:52 ` [PATCH v2 01/12] guestfs: Rename the update_ssh_config_guestfs role cel
2025-02-05 15:52 ` [PATCH v2 02/12] update_ssh_config: Use {{ sshconfig }} instead of raw path cel
2025-02-05 15:52 ` [PATCH v2 03/12] update_ssh_config: Fix ansible-lint nits cel
2025-02-05 15:52 ` [PATCH v2 04/12] update_ssh_config: Run update_ssh_config during "make deps" cel
2025-02-05 15:52 ` [PATCH v2 05/12] update_ssh_config: Add tags to steps cel
2025-02-05 15:52 ` [PATCH v2 06/12] ssh.Makefile: Generate an sshdir variable cel
2025-02-05 15:52 ` [PATCH v2 07/12] update_ssh_config: make Include directive follow ssh config directory cel
2025-02-06 19:58 ` Chuck Lever
2025-02-05 15:52 ` [PATCH v2 08/12] ssh.Makefile: Define a kdevops_ssh_config variable cel
2025-02-05 17:42 ` Luis Chamberlain
2025-02-06 2:36 ` Chuck Lever
2025-02-05 15:52 ` [PATCH v2 09/12] update_ssh_config: Add always-run ssh clean-up steps cel
2025-02-05 15:52 ` [PATCH v2 10/12] terraform: Add ssh hosts to ~/.ssh/config_kdevops_{{ sha1sum }} cel
2025-02-05 15:52 ` [PATCH v2 11/12] terraform: "make mrproper" should remove terraform/*/.terraform cel
2025-02-05 15:52 ` cel [this message]
2025-02-05 17:44 ` [PATCH v2 00/12] Replace terraform update_ssh_config module Luis Chamberlain
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=20250205155252.1317763-13-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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.