From patchwork Wed Feb 5 15:52:40 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever X-Patchwork-Id: 13961405 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 731D61519BD for ; Wed, 5 Feb 2025 15:52:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738770775; cv=none; b=u1kCKOriGqDJ+WRA1I1TdMEHgs1qhB3Fo9GSkcrwb8QUn9xZXPjHMOTcZD3LNrUhduD/qVJBWINmuU8epK/5OL8DWpF2RclMRIN573bPEcoyax8u4pNTuQDnEFRoOynoiA8d+vxGcJO9W93wF80tuDp+untulXdU9XZi+ZLL7wc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738770775; c=relaxed/simple; bh=/AYVe5ovu8sRMsMlGb9wyGtuw+LdL+RoKnxROPjwwNc=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=h49uQch9ng20/U32oMA9e2d88m3uQCdKPRyRalbsXreMIKxWbd4+FFQoyCwPMZx/7dgi/G5dxjO6ci3kD06qkJ5GJBI8fT76wz3Oqffej+5Ls8JZIUfp08P85vTdCuZNHbGOsXRQVZqoXtjs1Y+5S7pI5ZTsag65PPGTJzXdth8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=LOvOGLLs; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="LOvOGLLs" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A20A1C4CED1; Wed, 5 Feb 2025 15:52:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1738770774; bh=/AYVe5ovu8sRMsMlGb9wyGtuw+LdL+RoKnxROPjwwNc=; h=From:To:Cc:Subject:Date:From; b=LOvOGLLs6eR6PBQ/kw/xw5k+yu8rrLzAe4rj4YuKPYpB1DS/y/4T7bsVQVcJjFpk6 15nSpGD3848eHOM9nZ0rbsAsd7fuPbG6WGKzLgtiusbyKOMdxn+GIia3DhM21c/EpU iyO/L4/Uf+fRYXQp0V9kVIIweKngX8SykDWl+gdEU6rxzrwqW9mxsA95X9MSd5uxpU QiC51Vr7XgcM+RL3bEkWaD9D8gjQFNU/FW/xAY/UNtg1mVm9MEZbng9Oy4ySWrADff 2QZZKLdkk4FYixt4eKQ+NparptIt1wAoN2aKL/GWPihRxyT+K1I/QLiIhkupLZmNsj vBUo3MrbLqscw== From: cel@kernel.org To: Cc: Chuck Lever Subject: [PATCH v2 00/12] Replace terraform update_ssh_config module Date: Wed, 5 Feb 2025 10:52:40 -0500 Message-ID: <20250205155252.1317763-1-cel@kernel.org> X-Mailer: git-send-email 2.48.1 Precedence: bulk X-Mailing-List: kdevops@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Chuck Lever Luis suggested merging the way guestfs and terraform handle ssh host config. Luis, please let me know if I've grossly misunderstood your suggestion. Vagrant is deprecated, so it will not be modified by these changes. The two remaining virtualization mechanisms have the same underlying purpose: - Set up ssh to enable Ansible to have passwordless access to the target nodes - Make human ssh to the target nodes as painless as possible But they have grown apart in implementation over the years. This series is an attempt to build shared infrastructure that can be triggered by the common "bringup" and "destroy" make targets. Eventually IMO the SSH Kconfig options for terraform need to be merged with the options from kconfigs/Kconfig.ssh. This series does not attempt to do that. In preparation for possibly moving the location of the config_kdevops_* file, this series now treats the .ssh/config Include directive a bit more carefully and consistently. Changes since RFC: - Split the RFC series into smaller patches for easier review - The "Include" directive now follows CONFIG_KDEVOPS_SSH_CONFIG - Various bug fixes and optimizations Chuck Lever (12): guestfs: Rename the update_ssh_config_guestfs role update_ssh_config: Use {{ sshconfig }} instead of raw path update_ssh_config: Fix ansible-lint nits update_ssh_config: Run update_ssh_config during "make deps" update_ssh_config: Add tags to steps ssh.Makefile: Generate an sshdir variable update_ssh_config: make Include directive follow ssh config directory ssh.Makefile: Define a kdevops_ssh_config variable update_ssh_config: Add always-run ssh clean-up steps terraform: Add ssh hosts to ~/.ssh/config_kdevops_{{ sha1sum }} terraform: "make mrproper" should remove terraform/*/.terraform terraform: Remove the terrraform update_ssh_config module Makefile | 1 + playbooks/add_ssh_hosts_terraform.yml | 5 ++ .../add_ssh_hosts_terraform/defaults/main.yml | 2 + .../add_ssh_hosts_terraform/tasks/main.yml | 33 +++++++ .../templates/ssh_config.j2 | 15 ++++ .../roles/update_ssh_config/tasks/main.yml | 88 +++++++++++++++++++ .../update_ssh_config_guestfs/tasks/main.yml | 71 --------------- playbooks/update_ssh_config.yml | 4 + playbooks/update_ssh_config_guestfs.yml | 4 - scripts/bringup.Makefile | 6 ++ scripts/destroy_guestfs.sh | 6 -- scripts/guestfs.Makefile | 6 -- scripts/ssh.Makefile | 22 +++++ scripts/terraform.Makefile | 6 +- terraform/aws/output.tf | 30 ++----- terraform/aws/update_ssh_config.tf | 1 - terraform/azure/output.tf | 22 ++--- terraform/azure/update_ssh_config.tf | 1 - terraform/gce/output.tf | 31 ++----- terraform/gce/update_ssh_config.tf | 1 - terraform/oci/output.tf | 9 ++ terraform/oci/update_ssh_config.tf | 1 - terraform/openstack/output.tf | 9 ++ terraform/openstack/update_ssh_config.tf | 1 - terraform/update_ssh_config.tf | 17 ---- 25 files changed, 218 insertions(+), 174 deletions(-) create mode 100644 playbooks/add_ssh_hosts_terraform.yml create mode 100644 playbooks/roles/add_ssh_hosts_terraform/defaults/main.yml create mode 100644 playbooks/roles/add_ssh_hosts_terraform/tasks/main.yml create mode 100644 playbooks/roles/add_ssh_hosts_terraform/templates/ssh_config.j2 create mode 100644 playbooks/roles/update_ssh_config/tasks/main.yml delete mode 100644 playbooks/roles/update_ssh_config_guestfs/tasks/main.yml create mode 100644 playbooks/update_ssh_config.yml delete mode 100644 playbooks/update_ssh_config_guestfs.yml 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 create mode 100644 terraform/oci/output.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 Reviewed-by: Luis Chamberlain