-
Notifications
You must be signed in to change notification settings - Fork 2
/
debian.sh
executable file
·61 lines (51 loc) · 1.97 KB
/
debian.sh
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
#!/bin/bash
set -x
apt install python-pip -y
apt install \
vim \
python-dev \
python-netaddr \
python-openstackclient \
python-neutronclient \
libffi-dev \
libssl-dev \
gcc \
ansible \
bridge-utils \
docker.io -y
apt-get purge lxc lxd -y
pip install -U pip
mkdir -p /etc/systemd/system/docker.service.d
tee /etc/systemd/system/docker.service.d/kolla.conf <<-EOF
[Service]
MountFlags=shared
EOF
systemctl daemon-reload
systemctl enable dockerd
systemctl restart dockerd
systemctl stop libvirtd.service
systemctl disable libvirtd.service
pip install ansible==1.9.6
pip install kolla
cp -r /usr/local/share/kolla/etc_examples/kolla /etc/
NETWORK_INTERFACE="enp0s8"
NEUTRON_INTERFACE="enp0s9"
GLOBALS_FILE="/etc/kolla/globals.yml"
ADDRESS="$(ip -4 addr show ${NETWORK_INTERFACE} | grep "inet" | awk '{print $2}' | cut -d/ -f1)"
BASE="$(echo $ADDRESS | cut -d. -f 1,2,3)"
VIP=$(echo "${BASE}.254")
sed -i "s/^kolla_internal_vip_address:.*/kolla_internal_vip_address: ${VIP}/g" ${GLOBALS_FILE}
sed -i "s/^network_interface:.*/network_interface: ${NETWORK_INTERFACE}/g" ${GLOBALS_FILE}
sed -i "s/^neutron_external_interface:.*/neutron_external_interface: ${NEUTRON_INTERFACE}/g" ${GLOBALS_FILE}
echo "${ADDRESS} localhost" >> /etc/hosts
mkdir -p /etc/kolla/config/nova/
tee > /etc/kolla/config/nova/nova-compute.conf <<-EOF
[libvirt]
virt_type=qemu
EOF
kolla-genpwd
sed -i -e "s/^keystone_admin_password:.*/keystone_admin_password: Koll@0penst@ck/" /etc/kolla/passwords.yml
kolla-ansible prechecks
kolla-ansible pull
kolla-ansible deploy
echo "Login using http://${VIP}:8080/ with default as domain, admin as username, and $(cat /etc/kolla/passwords.yml | grep "keystone_admin_password" | awk '{print $2}') as password"