Make ./stack.sh optional
Create a new VAGRANT_KURYR_RUN_DEVSTACK environment variable to make the `stack.sh` call optional. Some people may want to edit the `local.conf` file before run `stack.sh` manually in the VM. Useful for the devstack/plugin.sh development, for instance. It is defaulted to `true` for backwards compatibility. Change-Id: Ia3fe8cb4416a75a3ec05cbb9ce698313daa555e4
This commit is contained in:
parent
1bbfb6afb6
commit
07687f4401
@ -45,3 +45,6 @@ the definition of the Virtual Machine spawned:
|
||||
|
||||
* **VAGRANT\_KURYR\_VM\_MEMORY**: To modify the RAM of the VM. Defaulted to: 4096
|
||||
* **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
|
||||
|
10
contrib/vagrant/Vagrantfile
vendored
10
contrib/vagrant/Vagrantfile
vendored
@ -2,8 +2,9 @@ VAGRANTFILE_API_VERSION = "2"
|
||||
|
||||
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
||||
|
||||
VM_MEMORY = ENV.fetch('VAGRANT_KURYR_VM_MEMORY', 4096)
|
||||
VM_CPUS = ENV.fetch('VAGRANT_KURYR_VM_CPUS', 2)
|
||||
VM_MEMORY = ENV.fetch('VAGRANT_KURYR_VM_MEMORY', 4096)
|
||||
VM_CPUS = ENV.fetch('VAGRANT_KURYR_VM_CPUS', 2)
|
||||
RUN_DEVSTACK = ENV.fetch('VAGRANT_KURYR_RUN_DEVSTACK', 'true')
|
||||
|
||||
config.vm.hostname = 'devstack'
|
||||
|
||||
@ -33,7 +34,10 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
||||
# For CentOS machines it needs to be specified
|
||||
config.vm.synced_folder '.', '/vagrant'
|
||||
|
||||
config.vm.provision :shell, :path => 'vagrant.sh'
|
||||
config.vm.provision :shell do |s|
|
||||
s.path = 'vagrant.sh'
|
||||
s.args = RUN_DEVSTACK
|
||||
end
|
||||
|
||||
if Vagrant.has_plugin?('vagrant-cachier')
|
||||
config.cache.scope = :box
|
||||
|
@ -3,6 +3,7 @@
|
||||
set -e
|
||||
|
||||
BASHPATH=$(dirname "$0"\")
|
||||
RUN_DEVSTACK="$1"
|
||||
echo "Run script from $BASHPATH"
|
||||
|
||||
# Copied shamelessly from Devstack
|
||||
@ -47,6 +48,9 @@ then
|
||||
|
||||
fi
|
||||
|
||||
# start devstack
|
||||
echo "Start Devstack"
|
||||
su "$OS_USER" -c "cd $DEVSTACK && ./stack.sh"
|
||||
if $RUN_DEVSTACK; then
|
||||
echo "Start Devstack"
|
||||
su "$OS_USER" -c "cd $DEVSTACK && ./stack.sh"
|
||||
else
|
||||
echo "Virtual Machine ready. You can run devstack by executing '/home/vagrant/devstack/stack.sh'"
|
||||
fi
|
||||
|
@ -4,7 +4,7 @@ export OS_USER=vagrant
|
||||
export OS_HOST_IP=172.68.5.10
|
||||
|
||||
# run script
|
||||
bash /vagrant/devstack.sh
|
||||
bash /vagrant/devstack.sh "$1"
|
||||
|
||||
#set environment variables for kuryr
|
||||
su "$OS_USER" -c "echo 'source /vagrant/config/kuryr_rc' >> ~/.bashrc"
|
||||
|
Loading…
Reference in New Issue
Block a user