Vagrant.configure("2") do |config|
config.hostmanager.ip_resolver = proc do |machine|
result = ""
machine.communicate.execute("ifconfig enp0s8") do |type, data|
result << data if type == :stdout
end
(ip = /inet (\d+\.\d+\.\d+\.\d+)/.match(result)) && ip[1]
end
config.hostmanager.enabled = true
config.hostmanager.manage_host = true
config.hostmanager.ignore_private_ip = false
config.hostmanager.include_offline = false
config.vm.box = "centos7"
config.vm.define "moge" do |node|
node.vm.hostname = "moge.localhost"
node.vm.network "private_network", type: "dhcp"
end
config.vm.define "hoge" do |node|
node.vm.hostname = "hoge.localhost"
node.vm.network "private_network", type: "dhcp"
end
config.vm.provider "virtualbox"
end