Skip to content
This repository has been archived by the owner on Jun 25, 2023. It is now read-only.

config.vm.define <hostname> is not honoured #307

Open
JPvRiel opened this issue Feb 15, 2017 · 1 comment
Open

config.vm.define <hostname> is not honoured #307

JPvRiel opened this issue Feb 15, 2017 · 1 comment

Comments

@JPvRiel
Copy link

JPvRiel commented Feb 15, 2017

In a Vagrantfile config, the Vagrant hostnames given by config.vm.define are ignored and landrush tries to rename the host to the same thing for each instance. Instead, it's using the current folder's name?

E.g. I get:

$ vagrant up --provider=libvirt
...
==> h1: Creating image (snapshot of base box volume).
==> h2: Creating image (snapshot of base box volume).
...
==> h1: [landrush] adding machine entry: dev-cluster.vagrant.test => 192.168.121.20
==> h2: [landrush] adding machine entry: dev-cluster.vagrant.test => 192.168.121.133

Using a config like

Vagrant.configure(2) do |config|

  config.vm.provider :libvirt do |domain, override|
    override.vm.box = 'centos/7'
  end

  config.landrush.enabled = true
  config.landrush.tld = 'vagrant.test'
  config.landrush.guest_redirect_dns = false
  config.landrush.host_redirect_dns = false

  config.vm.define 'h1'
  config.vm.define 'h2'

end

I'd expect h1.vagrant.test and h2.vagrant.test, not dev-cluster.vagrant.test

@JPvRiel
Copy link
Author

JPvRiel commented Mar 10, 2017

A workaround is to explicitly set the hostname.

E.g. untested example code

  hosts = ['h1', 'h2']
  hosts.each do |h|
    config.vm.define "#{h}" do | d |
       d.vm.hostname = "#{h}.#{config.landrush.tld}"
    end
  end

Obviously, that's less concise... but it helps landrush work.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants