forked from stackhpc/a-universe-from-nothing
-
Notifications
You must be signed in to change notification settings - Fork 0
/
a-universe-from-nothing.sh
executable file
·94 lines (72 loc) · 2.73 KB
/
a-universe-from-nothing.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#!/bin/bash
# Cheat script for a full deployment.
# This should be used for testing only.
set -eu
# Install git and tmux.
if $(which dnf 2>/dev/null >/dev/null); then
sudo dnf -y install git tmux
else
sudo apt update
sudo apt -y install git tmux
fi
# Disable the firewall.
sudo systemctl is-enabled firewalld && sudo systemctl stop firewalld && sudo systemctl disable firewalld
# Disable SELinux both immediately and permanently.
if $(which setenforce 2>/dev/null >/dev/null); then
sudo setenforce 0
sudo sed -i 's/^SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
fi
# Prevent sudo from performing DNS queries.
echo 'Defaults !fqdn' | sudo tee /etc/sudoers.d/no-fqdn
# Start at home.
cd
# Clone Kayobe.
[[ -d kayobe ]] || git clone https://opendev.org/openstack/kayobe.git -b stable/yoga
cd kayobe
# Clone the Tenks repository.
[[ -d tenks ]] || git clone https://opendev.org/openstack/tenks.git
# Clone this Kayobe configuration.
mkdir -p config/src
cd config/src/
[[ -d kayobe-config ]] || git clone https://github.com/stackhpc/a-universe-from-nothing.git -b stable/yoga kayobe-config
# Configure host networking (bridge, routes & firewall)
./kayobe-config/configure-local-networking.sh
# Install kayobe.
cd ~/kayobe
./dev/install-dev.sh
# Activate the Kayobe environment, to allow running commands directly.
# NOTE: Virtualenv's activate script references an unbound variable.
set +u
source ~/kayobe-venv/bin/activate
set -u
source config/src/kayobe-config/kayobe-env
# Bootstrap the Ansible control host.
kayobe control host bootstrap
# Configure the seed hypervisor host.
kayobe seed hypervisor host configure
# Provision the seed VM.
kayobe seed vm provision
# Configure the seed host, and deploy a local registry.
kayobe seed host configure
# Pull, retag images, then push to our local registry.
./config/src/kayobe-config/pull-retag-push-images.sh
# Deploy the seed services.
kayobe seed service deploy
# Deploying the seed restarts networking interface,
# run configure-local-networking.sh again to re-add routes.
./config/src/kayobe-config/configure-local-networking.sh
# NOTE: Make sure to use ./tenks, since just ‘tenks’ will install via PyPI.
export TENKS_CONFIG_PATH=config/src/kayobe-config/tenks.yml
./dev/tenks-deploy-overcloud.sh ./tenks
# Inspect and provision the overcloud hardware:
kayobe overcloud inventory discover
kayobe overcloud hardware inspect
kayobe overcloud introspection data save
kayobe overcloud provision
kayobe overcloud host configure
kayobe overcloud container image pull
kayobe overcloud service deploy
source config/src/kayobe-config/etc/kolla/public-openrc.sh
kayobe overcloud post configure
source config/src/kayobe-config/etc/kolla/public-openrc.sh
./config/src/kayobe-config/init-runonce.sh