Skip to content

Replace terraform update_ssh_config module

[email protected] kdevops 3 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest6 patches 0 repliesNew
  2. v212 patches 4 repliesSuperseded
  3. v1 RFC4 patches 0 repliesSuperseded

Changes in v3 from the cover letter

- Move terraform bringup/destroy into an Ansible playbook
- Move terraform's ssh configuration into that playbook
- Tested with AWS, Azure, and OCI

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6terraform: Replace scripts/*_terraform.sh with an Ansible playbookplaybooks/roles/terraform/tasks/main.yml playbooks/terraform.yml scripts/bringup_terraform.sh +2 more+33 -240 replies
2/6ssh.Makefile: Define a kdevops_ssh_config variablekconfigs/Kconfig.ssh scripts/ssh.Makefile+25 -40 replies
3/6terraform: Clean up ssh configuration during "make destroy"playbooks/roles/terraform/tasks/main.yml scripts/terraform.Makefile+10 -10 replies
4/6terraform: Add ssh hosts to ~/.ssh/config_kdevops_{{ sha1sum }}playbooks/roles/terraform/defaults/main.yml playbooks/roles/terraform/tasks/main.yml playbooks/roles/terraform/templates/ssh_config.j2 +6 more+131 -60 replies
5/6terraform: "make mrproper" should remove terraform/*/.terraformMakefile+1 -00 replies
6/6terraform: Remove the terrraform update_ssh_config moduleterraform/aws/output.tf terraform/aws/update_ssh_config.tf terraform/aws/update_ssh_config_use.tf +12 more+3 -1230 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

Cover letter [PATCH v3 0/6] Replace terraform update_ssh_config module

From: Chuck Lever <[email protected]>

Luis suggested merging the way guestfs and terraform handle ssh host config. This series is a step in that direction.

guestfs provisioning is currently implemented nearly entirely by shell scripts. That makes it somewhat high risk to re-write both terraform and guestfs to use shared infrastructure at the same time. So instead of building infrastructure that guestfs and terraform can share, I'm leaving guestfs out of the equation for the moment. All this series does is make terraform ssh configuration behave more like guestfs.

Subsequent work can replace the current set of guestfs scripts with Ansible playbooks, and then more common ssh infrastructure can be introduced that both provisioning methods can utilize.

Change since v2:
- Move terraform bringup/destroy into an Ansible playbook
- Move terraform's ssh configuration into that playbook
- Tested with AWS, Azure, and OCI

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 (6):
terraform: Replace scripts/*_terraform.sh with an Ansible playbook ssh.Makefile: Define a kdevops_ssh_config variable
terraform: Clean up ssh configuration during "make destroy"
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 +
 kconfigs/Kconfig.ssh                          | 19 +++-
 playbooks/roles/terraform/defaults/main.yml   |  3 +
 playbooks/roles/terraform/tasks/main.yml      | 86 +++++++++++++++++++
 .../roles/terraform/templates/ssh_config.j2   | 15 ++++
 playbooks/terraform.yml                       |  5 ++
 scripts/bringup_terraform.sh                  | 12 ---
 scripts/destroy_terraform.sh                  | 10 ---
 scripts/ssh.Makefile                          | 10 ++-
 scripts/terraform.Makefile                    | 35 ++++++--
 terraform/aws/output.tf                       | 30 ++-----
 terraform/aws/update_ssh_config.tf            |  1 -
 terraform/aws/update_ssh_config_use.tf        | 12 ---
 terraform/azure/output.tf                     | 22 ++---
 terraform/azure/update_ssh_config.tf          |  1 -
 terraform/azure/update_ssh_config_use.tf      |  4 -
 terraform/gce/output.tf                       | 31 ++-----
 terraform/gce/update_ssh_config.tf            |  1 -
 terraform/gce/update_ssh_config_use.tf        |  4 -
 terraform/oci/output.tf                       |  9 ++
 terraform/oci/update_ssh_config.tf            |  1 -
 terraform/oci/update_ssh_config_use.tf        |  8 --
 terraform/openstack/output.tf                 |  9 ++
 terraform/openstack/update_ssh_config.tf      |  1 -
 terraform/openstack/update_ssh_config_use.tf  |  4 -
 terraform/update_ssh_config.tf                | 17 ----
 26 files changed, 198 insertions(+), 153 deletions(-)
 create mode 100644 playbooks/roles/terraform/defaults/main.yml
 create mode 100644 playbooks/roles/terraform/tasks/main.yml
 create mode 100644 playbooks/roles/terraform/templates/ssh_config.j2
 create mode 100644 playbooks/terraform.yml
 delete mode 100755 scripts/bringup_terraform.sh
 delete mode 100755 scripts/destroy_terraform.sh
 delete mode 120000 terraform/aws/update_ssh_config.tf
 delete mode 100644 terraform/aws/update_ssh_config_use.tf
 delete mode 120000 terraform/azure/update_ssh_config.tf
 delete mode 100644 terraform/azure/update_ssh_config_use.tf
 delete mode 120000 terraform/gce/update_ssh_config.tf
 delete mode 100644 terraform/gce/update_ssh_config_use.tf
 create mode 100644 terraform/oci/output.tf
 delete mode 120000 terraform/oci/update_ssh_config.tf
 delete mode 100644 terraform/oci/update_ssh_config_use.tf
 delete mode 120000 terraform/openstack/update_ssh_config.tf
 delete mode 100644 terraform/openstack/update_ssh_config_use.tf
 delete mode 100644 terraform/update_ssh_config.tf
Signature · 1 line
2.48.1