
The current code appends hostname to 127.0.0.1 line on /etc/hosts if not set already. That approach is wrong, 127.0.0.1 should just contain localhost and in case there's no physical interface besides loopback then it should be added 127.0.1.1 <hostname>. This behaviour also breaks nodes managed by puppet with physical interfaces configured, like the baremetal00 node. If I set the /etc/hosts to: 127.0.0.1 localhost 15.184.64.4 baremetal00.vanilla.ic.openstack.org baremetal00 and run the install playbook, then baremetal00 is added to the 127.0.0.1 line, which makes puppet 'facter fqdn' command to return 'baremetal00' and thus puppet apply runs no longer work on the node as the site.pp contains the fqdn name for the node. This change simply greps for hostname on /etc/hosts and if not present then it continues the current (even wrong imho) of adding hostname to 127.0.0.1 For reference: https://www.debian.org/doc/manuals/debian-reference/ch05.en.html#_the_hostname_resolution Change-Id: I47f0a9c6777809911398ca25c66b83f8ee0221ec
Vagrant support for developers
Bifrost vagrant file for developers can be found in the
tools/vagrant_dev_env
directory. Running
vagrant up
from within this folder will bring up an Ubuntu
Trusty box with Bifrost installed.
By default, the VM will have three interfaces:
- eth0 - connected to a NAT network
- eth1 - connected to Host-only network named: vboxnet1
- eth2 - bridged - adapter must be set in Vagrantfile
Walkthrough done on OS X
Setup vagrant by:
- Installing git
- Installing virtualbox
- Installing vagrant
- Installing ansible
Configure Vagrant with the correct box:
vagrant box add ubuntu/trusty64
Clone bifrost repo:
git clone https://github.com/openstack/bifrost.git
Change into the bifrost directory:
cd bifrost/tools/vagrant_dev_env
Edit the Vagrantfile:
- Change the
bifrost.vm.network
public_network
value to a valid network interface to allow Bare Metal connectivity - Change
public_key
to correct key name - Change
network_interface
to match your needs
Boot the VM with:
vagrant up
Installation Options
Ansible is installed within the VM directly from source or from the
path set by ANSIBLE_GIT_URL
. You can modify the path of
installation by setting ANSIBLE_INSTALL_ROOT
environment
variable. The default value is /opt/stack
. When set in the
host, this variable will also be set as an environment variable inside
the VM for use by test scripts.
Note:
Only the ansible installation path is configurable at this point using the enviroment variable. All other dependencies will still continue to cloned under
/opt/stack
.