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

Hostname field not used

Open andybrook opened this issue 3 years ago • 1 comments

The hostname input field described here - https://github.com/MonolithProjects/terraform-libvirt-vm#input_hostname doesn't appear to be used.

Some conditional logic is probably needed here - https://github.com/MonolithProjects/terraform-libvirt-vm/blob/main/main.tf#L14 to define the "name" using "hostname" if that is defined rather than only "vm_hostname_prefix" with the count at the end.

Currently there seems no way to specify a single machine with a hostname not ending in a number.

Equally this may not be a required feature :-)

andybrook avatar Jul 03 '22 16:07 andybrook

Hi @andybrook , yeah it seems like the hostname variable does nothing (in fact it is used in cloud-init template but even there it does not work and can be omitted from there) https://github.com/MonolithProjects/terraform-libvirt-vm/blob/9ea3f36a354647aaef06444e9139992455b9bd96/templates/cloud_init.tpl#L13

But your point is still valid - it would be nice to have an option to specify a host name for a single VM. Will implement it later :wink:

MonolithProjects avatar Jul 06 '22 21:07 MonolithProjects