-
Notifications
You must be signed in to change notification settings - Fork 0
/
Vagrantfile
62 lines (48 loc) · 1.4 KB
/
Vagrantfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
$script = <<SCRIPT
sudo apt update
sudo apt install -y git bridge-utils crudini
git clone https://git.openstack.org/openstack-dev/devstack
cd devstack
cat << 'EOF' > local.conf
[[local|localrc]]
ADMIN_PASSWORD=secret
DATABASE_PASSWORD=$ADMIN_PASSWORD
RABBIT_PASSWORD=$ADMIN_PASSWORD
SERVICE_PASSWORD=$ADMIN_PASSWORD
LOGFILE=/opt/stack/logs/stack.sh.log
VERBOSE=True
LOG_COLOR=True
SCREEN_LOGDIR=/opt/stack/logs
enable_service neutron-trunk
enable_service neutron-segments
enable_service neutron-trunk
enable_service neutron-qos
disable_service tempest
EOF
IP=$(ip -o -4 a | awk '/3:/ {print $4}' | cut -d/ -f1)
echo "HOST_IP=${IP}" >> local.conf
crudini --set "/vagrant/tests/etc/tempest.conf" identity uri_v3 "http://${IP}/identity/v3/"
./stack.sh
echo "source ~/devstack/openrc admin admin" >> ~/.bashrc
for p in cinder keystone neutron nova glance; do
DIR="/vagrant/tests/etc/$p"
mkdir -p $DIR
if [ $p = "glance" ]
then
cp /etc/$p/policy.json $DIR/policy.json
else
oslopolicy-policy-generator --namespace $p --output-file $DIR/policy.json 2>/dev/null
fi
done
SCRIPT
Vagrant.configure("2") do |cfg|
cfg.vm.define :devstack, primary: true do |c|
c.vm.box = "ubuntu/bionic64"
c.vm.provision :shell, privileged: false, inline: $script
c.vm.network "private_network", type: "dhcp", adapter: 2
c.vm.provider :virtualbox do |v|
v.memory = 7168
v.cpus = 4
end
end
end