mbox series

[v2,00/12] Replace terraform update_ssh_config module

Message ID 20250205155252.1317763-1-cel@kernel.org (mailing list archive)
Headers show
Series Replace terraform update_ssh_config module | expand

Message

Chuck Lever Feb. 5, 2025, 3:52 p.m. UTC
From: Chuck Lever <chuck.lever@oracle.com>

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

Comments

Luis Chamberlain Feb. 5, 2025, 5:44 p.m. UTC | #1
On Wed, Feb 05, 2025 at 10:52:40AM -0500, cel@kernel.org wrote:
> From: Chuck Lever <chuck.lever@oracle.com>
> 
> Luis suggested merging the way guestfs and terraform handle ssh
> host config. Luis, please let me know if I've grossly misunderstood
> your suggestion.

Looks good to me, specially if it works :) I just made a comment about
one small nit.

Reviewed-by: Luis Chamberlain <mcgrof@kernel.org>

 Luis