/
5_openstack_install.sh
executable file
·32 lines (23 loc) · 1.19 KB
/
5_openstack_install.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
#!/bin/bash
set -e
VENV_PATH=/opt/kolla
cd $VENV_PATH
source $VENV_PATH/bin/activate
# deploy cluster, e.g. controller and compute (monitor,storage,neutron)
kolla-ansible -i /mnt/config/inventory deploy
# create openrc and install client
pip install python-openstackclient
pip install python-glanceclient
# generates the ENV vars to /etc/kolla/admin-openrc.sh to be able to authenticate the openstack cli
kolla-ansible -i /mnt/config/inventory post-deploy
cd /opt/kolla
. /etc/kolla/admin-openrc.sh
# Rather ruse README.setup.md instead
#/opt/kolla/share/kolla-ansible/init-runonce
echo "making controller a chassis"
ssh controller1 -- docker exec openvswitch_vswitchd ovs-vsctl set open . external-ids:ovn-cms-options="enable-chassis-as-gw"
echo "If you like, run /mnt/config/bin/setup_defaults.sh to setup the defaults for convinient testing"
source /etc/kolla/admin-openrc.sh
echo "Creating application toke you can use for your cli or terraform. The secret is 'very_very_secret_key'"
openstack application credential create --role admin --description terraform --secret very_very_secret_key -f value -c id terraform
echo "Note down the above client-id to use with your token secret 'very_very_secret_key'"