terraform-provider-libvirt icon indicating copy to clipboard operation
terraform-provider-libvirt copied to clipboard

Documentation mismatch about `known_hosts` and `knownhosts`

Open CieNTi opened this issue 3 years ago • 0 comments

System Information

Linux distribution

Fedora 34 (running all Terraform commands under Docker)

Terraform version

$ terraform -v
Terraform v1.0.4
on linux_amd64
+ provider registry.terraform.io/dmacvicar/libvirt v0.6.10
+ provider registry.terraform.io/hashicorp/cloudinit v2.2.0
+ provider registry.terraform.io/hashicorp/local v2.1.0

Provider and libvirt versions

$ terraform-provider-libvirt -version
/home/user/.terraform.d/plugin-cache/registry.terraform.io/dmacvicar/libvirt/0.6.10/linux_amd64/terraform-provider-libvirt_v0.6.10 0.6.10

Checklist

  • [x] Is it a bug or something that does not work as expected? Please make sure you fill the version information below:

Description of Issue/Question

There is no official documentation on how to correctly set the known_hosts file, and the information found is confusing or wrong.

According the terraform-provider-libvirt page (or the GitHub source), and with some exceptions, the connection URIs will follow libvirt Connection URIs.

Taking a look into libvirt URIs Extra parameters, it is defined known_hosts as the expected parameter (and at the same time is not supported by ssh transport, which sounds really weird to me. It is maybe an errata, but I didn't checked it).

Taking a look into terraform-provider-libvirt code:

  • Line 18 defines default value to ${HOME}/.ssh/known_hosts, as one may expect
  • Line 25 uses it, but it expects knownhosts URI option

Apart of that, there is no example or documentation I could found about this.

Is this the expected behaviour, as official libvirt does not support known_hosts for ssh transport? Or it is just a terraform-provider-libvirt errata?

Thanks for your provider, time and support.

Not working setup

provider "libvirt" {
  uri = "qemu+ssh://user@host/system?known_hosts=/path/to/known_hosts"
}

Working setup

provider "libvirt" {
  uri = "qemu+ssh://user@host/system?knownhosts=/path/to/known_hosts"
}

Additional information:

Nothing to add

CieNTi avatar Aug 21 '21 21:08 CieNTi