dmacvicar / terraform-provider-libvirt

Terraform provider to provision infrastructure with Linux's KVM using libvirt
Apache License 2.0
1.54k stars 457 forks source link

expanded ssh_config parameters for qemu+ssh uri option #1059

Open memetb opened 6 months ago

memetb commented 6 months ago

Hello @dmacvicar,

this PR is in relation to the issue #1058 I recently opened.

This is a preliminary PR and work in progress. I have listed the known issues with this PR at this point. I would also like to get feedback from you before putting more effort in.

This feature is a must-have for my use case since I require to access my bare metal servers through a bastion host.

Known issues:

  1. using ProxyJump with openssh implementation of ssh will ask the bastion host to resolve the HostName. This allows for local resolution (e.g. private and/or dynamic IP addresses) to be used for the hostname resolution (i.e. a machine may have a name that is only locally resolvable on the bastion). The current code will not forward the name resolution from the bastion host.
  2. there is a hardcoded maximum depth of 10 jump hosts 3. little to no effort on code style and documentation: this was a quick and dirty feature feasibility test to see if the desired workflow worked correctly
  3. no unit tests have been added
tuxillo commented 3 months ago

will this ever be merged?

memetb commented 3 months ago

@tuxillo fyi, I'm using my forked project in production. I haven't published that project on terraform specifically because I want to keep the noise ratio down, but if you so wish, you can use the forked project's production branch which has this merged as well as a couple of other small features merged in.

gthieleb commented 3 months ago

@tuxillo fyi, I'm using my forked project in production. I haven't published that project on terraform specifically because I want to keep the noise ratio down, but if you so wish, you can use the forked project's production branch which has this merged as well as a couple of other small features merged in.

@dmacvicar This looks like good improvement regarding the ssh connection. May you have a look regarding compatibility, etc. if this can be merged into upstream?