Skip to content
This repository has been archived by the owner on Jan 18, 2020. It is now read-only.

Custom IP getter #21

Open
mihsmha opened this issue Nov 8, 2017 · 1 comment
Open

Custom IP getter #21

mihsmha opened this issue Nov 8, 2017 · 1 comment

Comments

@mihsmha
Copy link

mihsmha commented Nov 8, 2017

I'm trying to set IP using this in VagrantFile:

config.dnsmasq.ip = proc do |guest_machine| 
     guest_machine.communicate.sudo("hostname -I | awk '{print $NF}'") do |type, data| 
       data
    end
end

But there are not any changes in dnsmasq.conf

What's wrong?

@fongd
Copy link

fongd commented Mar 20, 2018

Same problem here with 0.1.1. Normally I have this configured in my Vagrantfile:

  config.dnsmasq.domain = ".devel"
  config.dnsmasq.ip = proc do |guest_machine| 
    guest_machine.communicate.execute("ifconfig eth1 | grep 'inet addr' | cut -d ':' -f 2 | cut -d ' ' -f 1") do |type, data| 
      # return something like '192.168.59.100' or ['192.168.59.100', '192.168.59.103']
    end
  end

  brew_prefix = `brew --prefix`.strip
  config.dnsmasq.dnsmasqconf = brew_prefix + '/etc/dnsmasq.conf'

  config.dnsmasq.reload_command = 'sudo launchctl unload /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist; sudo launchctl load /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist'

After I originally installed dnsmasq through homebrew, the changes made it into /usr/local/etc/dnsmasq.conf.

However, now if my IP address changes, the changes don't get written to dnsmasq.conf. Even if I hardcode a random IP address, the plugin recognizes it:

==> default: Checking for guest additions in VM...
==> default: Dnsmasq handler actived
==> default: Dnsmasq handler set IP '192.168.0.8' for domain '.devel'
==> default: Setting hostname...
==> default: Configuring and enabling network interfaces...

But checking dnsmasq.conf, the changes never make it in there. My old IP address remains there instead.

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

No branches or pull requests

2 participants