forked from markgoddard/bikolla
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbifrost.sh
executable file
·41 lines (34 loc) · 1.19 KB
/
bifrost.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
#!/bin/bash
# Install bifrost, use it to build a CentOS image and deploy all nodes.
set -e
# Required for building configdrives.
sudo yum -y install genisoimage
if [[ ! -d bifrost ]]; then
git clone https://github.com/openstack/bifrost
pushd bifrost
# Checkout https://review.openstack.org/#/c/633476/, which includes two minor
# fixes.
git fetch https://git.openstack.org/openstack/bifrost refs/changes/76/633476/2 && git checkout FETCH_HEAD
popd
fi
virtualenv --system-site-packages bifrost-venv
if [[ ! -L bifrost-venv/lib/python2.7/site-packages/selinux ]]; then
ln -s /usr/lib64/python2.7/site-packages/selinux/ bifrost-venv/lib/python2.7/site-packages/
fi
source bifrost-venv/bin/activate
pip install -U pip
pip install -U setuptools
pip install ./bifrost
pip install ansible
# Required to build images.
pip install diskimage-builder
# Required by bifrost_inventory.py
pip install shade
# Create an image.
cd bifrost/playbooks
export VENV=$VIRTUAL_ENV
ansible-playbook -i inventory/target -e @../../bifrost.yml install.yaml
# Deploy nodes.
export OS_CLOUD=bifrost
export BIFROST_INVENTORY_SOURCE=ironic
ansible-playbook -i inventory/bifrost_inventory.py -e @../../bifrost.yml deploy-dynamic.yaml