fgrehm/vagrant-lxc

Specified node.vm.network ip address doesn't correspond

Opened this issue · 3 comments

The specified node.vm.network.ip doesn't correspond with the one finally assigned by Vagrant.

# ...
  if RUBY_PLATFORM.include? 'linux'
    node.vm.network :private_network, ip: '198.51.100.3', lxc__bridge_name: 'bridge-yeah01'
    node.vm.box = 'fgrehm/centos-6-64-lxc'
    node.vm.provider :lxc do |lxc|
      lxc.container_name = :node_profile
    end
  else
# ...

And the vagrant up does this result :

==> YEAHMAN: Starting container...
==> YEAHMAN: Waiting for machine to boot. This may take a few minutes...
    YEAHMAN: SSH address: 10.0.3.233:22
    YEAHMAN: SSH username: vagrant
    YEAHMAN: SSH auth method: private key

I wonder why in the Vagrantfile, the IP is 198.51.100.3 and the vagrant up says 10.0.3.233.

And also in the /etc/hosts :

198.51.100.3    YEAHMAN

I can connect to the machine using vagrant ssh, but the Ansible provision fails :

TASK [Gathering Facts] *********************************************************
fatal: [YEAHMAN]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: ssh: connect to host YEAHMAN port 22: No route to host\r\n", "unreachable": true}
	to retry, use: --limit @/home/dctremblay/Projects/yeahman-project/install-server.retry

PLAY RECAP *********************************************************************
YEAHMAN                   : ok=0    changed=0    unreachable=1    failed=0   

What am I doing wrong ?

Thank you very much and have a great day !

I don't know what you're doing wrong, but when you find out and if it's a problem related to vagrant-lxc (it might just be a misconfigured LXC installation. getting networking to work well can be tricky) a patch is welcome.

@hsoft Hey sup Virgil !

I will try to check to LXC networking.

What does your node.vm.network looks like ?

Thanks !

I don't have a node.vm.network line in my vagrant configurations (I don't do fancy stuff network-wise with vagrant-lxc). My LXC default configuration already includes network config so vagrant doesn't have to touch anything.