From 01a56577b69495b8bc78633ebf1bfe569547bc5c Mon Sep 17 00:00:00 2001 From: Kyle Mestery Date: Mon, 28 Dec 2015 15:34:18 -0600 Subject: [PATCH] Allow for user specified local.conf changes with Vagrant This adds the ability for the user to inject additional configuration into local.conf during the provisioning step. One can change the Neutron plugin, for example, using this configuration. Change-Id: If778960edb1d9c3a23c7947c5ba3bf8a07bdfc3a Signed-off-by: Kyle Mestery --- .gitignore | 3 +++ contrib/vagrant/README.md | 19 ++++++++++++++++++- contrib/vagrant/devstack.sh | 4 ++++ 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 3cab1c36..59a7be2f 100644 --- a/.gitignore +++ b/.gitignore @@ -55,3 +55,6 @@ contrib/vagrant/.vagrant # Configuration files etc/kuryr.conf etc/kuryr.conf.sample + +# Ignore user specific local.conf settings for vagrant +contrib/vagrant/user_local.conf diff --git a/contrib/vagrant/README.md b/contrib/vagrant/README.md index 860e793a..9b9f9d6d 100644 --- a/contrib/vagrant/README.md +++ b/contrib/vagrant/README.md @@ -47,4 +47,21 @@ the definition of the Virtual Machine spawned: * **VAGRANT\_KURYR\_VM\_CPU**: To modify the cpus of the VM. Defaulted to: 2 * **VAGRANT\_KURYR\_RUN\_DEVSTACK**: Whether `vagrant up` should run devstack to have an environment ready to use. Set it to 'false' if you want to edit - `local.conf` before run ./stack.sh manually in the VM. Defaulted to: true + `local.conf` before run ./stack.sh manually in the VM. Defaulted to: true. + See below for additional options for editing local.conf. + +Additional devstack configuration +--------------------------------- + +To add additional configuration to local.conf before the VM is provisioned, you can +create a file called "user_local.conf" in the contrib/vagrant directory of +networking-kuryr. This file will be appended to the "local.conf" created during the +Vagrant provisioning. + +For example, to use OVN as the Neutron plugin with Kuryr, you can create a +"user_local.conf" with the following configuration: + + enable_plugin networking-ovn http://git.openstack.org/openstack/networking-ovn + enable_service ovn-northd + enable_service ovn-controller + disable_service q-agt diff --git a/contrib/vagrant/devstack.sh b/contrib/vagrant/devstack.sh index 7440d77f..3affe24a 100755 --- a/contrib/vagrant/devstack.sh +++ b/contrib/vagrant/devstack.sh @@ -44,6 +44,10 @@ then # copy local.conf.sample settings (source: kuryr/devstack/local.conf.sample) cp /devstack/local.conf.sample $DEVSTACK/local.conf + # If local settings are present, append them + if [ -f "/vagrant/user_local.conf" ]; then + cat /vagrant/user_local.conf >> $DEVSTACK/local.conf + fi chown "$OS_USER":"$OS_USER" "$DEVSTACK"/local.conf fi