Move proxy_command to config and support templating (#1226)

Migrate the proxy_command specification to the config and add support
for user override template to be used for edge cases. Moving it to the
config allows mistakes in the interpolation to be caught before the
machine is brought up.

Note this uses a more restrictive replacement to avoid requiring
escaping of '%' or '$'.

Issue #921 already partially resolved thanks to @ElArtista, this
completes the fix by allowing users to override as needed.

Fixes: #921
This commit is contained in:
Darragh Bailey
2021-03-21 15:19:53 +00:00
committed by GitHub
parent 188cb5a5f4
commit a16c3f7898
5 changed files with 133 additions and 8 deletions

View File

@@ -400,6 +400,13 @@ URI](http://libvirt.org/uri.html):
Default is `$HOME/.ssh/id_rsa`. Prepends `$HOME/.ssh/` if no directory
* `socket` - Path to the Libvirt unix socket (e.g.
`/var/run/libvirt/libvirt-sock`)
* `proxy_command` - For advanced usage. When connecting to remote libvirt
instances, if the default constructed proxy\_command which uses `-W %h:%p`
does not work, set this as needed. It performs interpolation using `{key}`
and supports only `{host}`, `{username}`, and `{id_ssh_key_file}`. This is
to try and avoid issues with escaping `%` and `$` which might be necessary
to the ssh command itself. e.g.:
`libvirt.proxy_command = "ssh {host} -l {username} -i {id_ssh_key_file} nc %h %p"`
* `uri` - For advanced usage. Directly specifies what Libvirt connection URI
vagrant-libvirt should use. Overrides all other connection configuration
options