Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can't set different hostname with vsphere provider #91

Closed
hashibot opened this issue Jun 13, 2017 · 1 comment · Fixed by #79
Closed

can't set different hostname with vsphere provider #91

hashibot opened this issue Jun 13, 2017 · 1 comment · Fixed by #79
Labels
enhancement Type: Enhancement

Comments

@hashibot
Copy link

This issue was originally opened by @jeroenjacobs1205 as hashicorp/terraform#14659. It was migrated here as part of the provider split. The original body of the issue is below.


Terraform Version

0.9.3

Affected Resource(s)

Please list the resources as a list, for example:

  • vsphere_virtual_machine

I have particular use-case where the hostname needs to be configured differently from the vm name. I thought this was possible with customizations, seems not...

Snippet:

resource "vsphere_virtual_machine" "dns_instance" {

  count = "${var.count}"
  name = "${var.environment}-${var.name}-${format("%03d", count.index+1)}"
  domain = "${var.dns_domain}"
	dns_servers = "${split(",", var.dns_servers)}"
	dns_suffixes = "${split(",", var.dns_suffixes)}"

  vcpu   = "${var.vcpu}"
  memory = "${var.memory}"

  network_interface {
    label = "${var.vm_network}"
    ipv4_address = "${element(split(",", var.ips),count.index)}"
    ipv4_gateway = "${var.gateway}"
    ipv4_prefix_length = "${element(split("/",var.cidr),1)}"
  }

  disk {
    template = "${var.vm_template}"
    datastore = "${var.vm_datastore}"
    type = "thin"
  }

  custom_configuration_parameters = {
    role = "${var.role}"
    hostname = "${var.name}-${format("%03d", count.index+1)}"
  }

}

As you can see, the vm name in vsphere contains the environment in it's name. However, this should not be present in /etc/hostname.

I was hoping I could override this with the custom_configuration_parameters section, but "hostname" gets ignored.

I can barely find information which variables are valid within custom_configuration_parameters. I assume "hostname" is the correct one, but I'm not sure.

PS: Maybe the TF documentation should contain some info about the most trivial variables that are valid custom configuration parameters. It's just plain guesswork at the moment...

@vancluever
Copy link
Contributor

Hey @jeroenjacobs1205! As you might have seen, thanks to @ewypych we now have the capability to perform hostname customization. This will available in the next release.

Thanks!

@vancluever vancluever added enhancement Type: Enhancement and removed bug Type: Bug labels Aug 24, 2017
@ghost ghost locked and limited conversation to collaborators Apr 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Type: Enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants