Getting Started: Fix IP address determination on F17

The format of the output of ifconfig has changed between Fedora 16 and
Fedora 17, so starting the metadata server failed on the latter due to a
missing IP address.

The change makes the script work with either format, and also now fails
with an error if it breaks again.

Change-Id: I7012af7bd7c15f6a962d19e66c8a0d8401243895
Signed-off-by: Zane Bitter <zbitter@redhat.com>
This commit is contained in:
Zane Bitter 2012-10-15 11:57:11 +02:00
parent b53436bf40
commit 47c79a2051

View File

@ -305,8 +305,8 @@ Configure the Metadata server
Some templates require the ``heat-metadata`` server also. The metadata server must be configured to bind to the IP address of the host machine on the Nova network created above (``demonetbr0``). This allows the launched instances to access the metadata server. However, the bridge interface is not actually created until an instance is launched in Nova. If you have completed the preceding steps the bridge will now have been created, so you can proceed to edit the file ``/etc/heat/heat-metadata.conf`` to change the ``bind_host`` value from the default ``0.0.0.0`` to the correct IP address and launch the metadata server::
BIND_IP=`ifconfig demonetbr0 | sed -e 's/ *inet addr:\([0-9.]\+\).*/\1/' -e t -e d`
sudo sed -i -e "/^bind_host *=/ s/0\.0\.0\.0/${BIND_IP}/" /etc/heat/heat-metadata.conf
BIND_IP=`ifconfig demonetbr0 | sed -e 's/ *inet \(addr:\)\?\([0-9.]\+\).*/\2/' -e t -e d`
sudo sed -i -e "/^bind_host *=/ s/0\.0\.0\.0/${BIND_IP:?}/" /etc/heat/heat-metadata.conf
sudo -E bash -c 'heat-metadata &'