Is there an issue with assigning static IP address to custom boxes?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Is there an issue with assigning static IP address to custom boxes?

William Saxton
Not sure if this is a common issue, but I've easily set up a VM with static IP using the following:

Vagrantfile:

  config.vm.define "swrmsca" do |swrmsca|
    swrmsca.vm.box = "bento/centos-7.2"
    swrmsca.vm.network "private_network", ip: "192.168.1.101"
    swrmsca.vm.hostname = "swrmsca.local"
  end

ifconfig output:

[vagrant@swrmsca ~]$ ifconfig
...
enp0s8: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.101  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 fe80::a00:27ff:fe2a:37c6  prefixlen 64  scopeid 0x20<link>

I went ahead and create this box, added some packages (puppet client), then repackaged it up as puppet_client.box.

# vagrant package --output puppet_client.box
# vagrant box add puppet_client puppet_client.box

When I try to bring up this VM, though, the static IP is never assigned:

Vagrantfile:

  config.vm.define "swrmsca" do |swrmsca|
    swrmsca.vm.box = "puppet_client"
    swrmsca.ssh.insert_key = false
    swrmsca.vm.network "private_network", ip: "192.168.1.101"
    swrmsca.vm.hostname = "swrmsca.local"
  end

ifconfig output:

[vagrant@swrmsca ~]$ ifconfig
...
enp0s8: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet6 fe80::a00:27ff:fe1a:209d  prefixlen 64  scopeid 0x20<link>


Did I do something wrong with the packaging?

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/775537ed-5237-4e00-95b9-05c802e0c21d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.