From 0b4ed976346be0320dd2e1aaeb64af170377ec59 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Martin=20Andr=C3=A9?= <m.andre@redhat.com>
Date: Mon, 14 Sep 2015 18:54:28 +0900
Subject: [PATCH] Preconfigure Kolla to work out of the box

This is intended for a development or PoC environment, and certainly
not production.

Partially-Implements: blueprint vagrant-improvements
Change-Id: I619ef9be308c2296e06c5353cebec40d95b29eb3
---
 vagrant/bootstrap.sh | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/vagrant/bootstrap.sh b/vagrant/bootstrap.sh
index 81d0aa3af3..ca3e75939a 100644
--- a/vagrant/bootstrap.sh
+++ b/vagrant/bootstrap.sh
@@ -79,6 +79,16 @@ EOF
     resize2fs /dev/VolGroup00/LogVol00
 }
 
+function configure_kolla {
+    # Use local docker registry
+    sed -i -r "s,^[# ]*docker_registry:.+$,docker_registry: \"${REGISTRY}\"," /etc/kolla/globals.yml
+    sed -i -r "s,^[# ]*docker_namespace:.+$,docker_namespace: \"lokolla\"," /etc/kolla/globals.yml
+    sed -i -r "s,^[# ]*docker_insecure_registry:.+$,docker_insecure_registry: \"True\"," /etc/kolla/globals.yml
+    # Set network interfaces
+    sed -i -r "s,^[# ]*network_interface:.+$,network_interface: \"eth1\"," /etc/kolla/globals.yml
+    sed -i -r "s,^[# ]*neutron_external_interface:.+$,neutron_external_interface: \"eth2\"," /etc/kolla/globals.yml
+}
+
 # Configure the operator node and install some additional packages.
 function configure_operator {
     yum install -y git mariadb && yum clean all
@@ -94,6 +104,8 @@ function configure_operator {
     cp -r ~vagrant/kolla/etc/kolla/ /etc/kolla
     chown -R vagrant: /etc/kolla
 
+    configure_kolla
+
     # Make sure Ansible uses scp.
     cat > ~vagrant/.ansible.cfg <<EOF
 [defaults]