public inbox for kdevops@lists.linux.dev
 help / color / mirror / Atom feed
From: Luis Chamberlain <mcgrof@kernel.org>
To: Chuck Lever <cel@kernel.org>, Daniel Gomez <da.gomez@kruces.com>,
	kdevops@lists.linux.dev
Cc: Luis Chamberlain <mcgrof@kernel.org>
Subject: [PATCH 1/8] terraform: Use directory checksum in SSH key filenames
Date: Sat,  6 Dec 2025 08:56:15 -0800	[thread overview]
Message-ID: <20251206165624.2640158-2-mcgrof@kernel.org> (raw)
In-Reply-To: <20251206165624.2640158-1-mcgrof@kernel.org>

SSH keys now use directory-based checksums to support multiple kdevops
installations coexisting without conflicts. The SSH key filename format
is now ~/.ssh/kdevops_terraform_<checksum> where checksum is the first
8 characters of the SHA256 hash of the kdevops directory path.

This was previously only applied to Lambda Labs provider but is now the
default for all providers, as it solves the general problem of multiple
installations sharing the same home directory.

Also fix OCI Kconfig generation scripts to use --quiet flag correctly
to suppress progress output when generating dynamic Kconfig files.

Generated-by: Claude AI
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
---
 terraform/Kconfig.ssh                      | 7 +++++--
 terraform/oci/scripts/gen_kconfig_image    | 6 ++++++
 terraform/oci/scripts/gen_kconfig_location | 6 ++++++
 terraform/oci/scripts/gen_kconfig_shape    | 6 ++++++
 4 files changed, 23 insertions(+), 2 deletions(-)

diff --git a/terraform/Kconfig.ssh b/terraform/Kconfig.ssh
index 4e239a35..b03f962f 100644
--- a/terraform/Kconfig.ssh
+++ b/terraform/Kconfig.ssh
@@ -21,14 +21,17 @@ config TERRAFORM_SSH_CONFIG_USER
 
 config TERRAFORM_SSH_CONFIG_PUBKEY_FILE
 	string "File containing Ansible's ssh public key"
-	default "~/.ssh/kdevops_terraform_$(shell, echo $(TOPDIR_PATH) | sha256sum | cut -c1-8).pub" if TERRAFORM_LAMBDALABS
-	default "~/.ssh/kdevops_terraform.pub"
+	default "~/.ssh/kdevops_terraform_$(shell, echo $(TOPDIR_PATH) | sha256sum | cut -c1-8).pub"
 	help
 	  The filename of the file containing an ssh public key
 	  Ansible is to use to manage its target nodes. The
 	  matching private key should be located in a file using
 	  the same basename (without the ".pub").
 
+	  The filename includes an 8-character hash of the current
+	  directory path, allowing multiple kdevops installations to
+	  use separate SSH keys without conflicts.
+
 config TERRAFORM_SSH_CONFIG_GENKEY
 	bool "Should we create a new random key for you?"
 	default y
diff --git a/terraform/oci/scripts/gen_kconfig_image b/terraform/oci/scripts/gen_kconfig_image
index 977446fd..55dfcf6c 100755
--- a/terraform/oci/scripts/gen_kconfig_image
+++ b/terraform/oci/scripts/gen_kconfig_image
@@ -718,6 +718,12 @@ def main():
     """Main function to run the program."""
     args = parse_arguments()
 
+    # Check for OCI config early - exit silently if not configured
+    if not os.path.exists(os.path.expanduser("~/.oci/config")):
+        if not args.quiet:
+            print("OCI not configured - skipping (optional)", file=sys.stderr)
+        sys.exit(0)
+
     if args.publishers:
         # Show both known and discovered publishers
         compartment_ocid = get_default_compartment()
diff --git a/terraform/oci/scripts/gen_kconfig_location b/terraform/oci/scripts/gen_kconfig_location
index 17ec8266..b397f534 100755
--- a/terraform/oci/scripts/gen_kconfig_location
+++ b/terraform/oci/scripts/gen_kconfig_location
@@ -432,6 +432,12 @@ def main():
     """Main function to run the program."""
     args = parse_arguments()
 
+    # Check for OCI config early - exit silently if not configured
+    if not os.path.exists(os.path.expanduser("~/.oci/config")):
+        if not args.quiet:
+            print("OCI not configured - skipping (optional)", file=sys.stderr)
+        sys.exit(0)
+
     if not args.quiet:
         print("Fetching list of OCI region subscriptions...", file=sys.stderr)
     regions = get_all_regions()
diff --git a/terraform/oci/scripts/gen_kconfig_shape b/terraform/oci/scripts/gen_kconfig_shape
index 09dd6d6f..d65ff37d 100755
--- a/terraform/oci/scripts/gen_kconfig_shape
+++ b/terraform/oci/scripts/gen_kconfig_shape
@@ -887,6 +887,12 @@ def main():
     """Main function to run the program."""
     args = parse_arguments()
 
+    # Check for OCI config early - exit silently if not configured
+    if not os.path.exists(os.path.expanduser("~/.oci/config")):
+        if not args.quiet:
+            print("OCI not configured - skipping (optional)", file=sys.stderr)
+        sys.exit(0)
+
     compartment_ocid = get_default_compartment()
     if not compartment_ocid:
         print("Error: Could not determine compartment OCID", file=sys.stderr)
-- 
2.51.0


  reply	other threads:[~2025-12-06 16:56 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-06 16:56 [PATCH 0/8] neoclouds: add new datacrunch / verda support Luis Chamberlain
2025-12-06 16:56 ` Luis Chamberlain [this message]
2025-12-06 22:28   ` [PATCH 1/8] terraform: Use directory checksum in SSH key filenames Chuck Lever
2025-12-12 19:14     ` Chuck Lever
2025-12-15 15:41       ` Chuck Lever
2025-12-06 16:56 ` [PATCH 2/8] devconfig: Add tmux.conf copying to target systems Luis Chamberlain
2025-12-06 16:56 ` [PATCH 3/8] terraform: Enable fact gathering for localhost Luis Chamberlain
2025-12-07 16:23   ` Chuck Lever
2025-12-06 16:56 ` [PATCH 4/8] terraform: Add DataCrunch GPU cloud provider integration Luis Chamberlain
2025-12-16 16:12   ` Chuck Lever
2025-12-06 16:56 ` [PATCH 5/8] kconfig: Add support for merging defconfig fragments Luis Chamberlain
2025-12-07 16:25   ` Chuck Lever
2025-12-07 20:37   ` Daniel Gomez
2025-12-06 16:56 ` [PATCH 6/8] terraform: Add tier-based GPU selection for Lambda Labs Luis Chamberlain
2025-12-16 18:05   ` Chuck Lever
2025-12-06 16:56 ` [PATCH 7/8] terraform: Document " Luis Chamberlain
2025-12-16 19:30   ` Chuck Lever
2025-12-06 16:56 ` [PATCH 8/8] docs: Organize cloud providers with Neoclouds section 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=20251206165624.2640158-2-mcgrof@kernel.org \
    --to=mcgrof@kernel.org \
    --cc=cel@kernel.org \
    --cc=da.gomez@kruces.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