forked from splitwood/cinder-standalone
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcinder-standalone.sh
executable file
·84 lines (67 loc) · 2.93 KB
/
cinder-standalone.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
#!/bin/bash
set -eux
# Pin to a known good DLRN repo
export DELOREAN_REPO_URL=${DELOREAN_REPO_URL:-"https://trunk.rdoproject.org/centos7/18/42/184244eb4ad0a5bd2e5ea7bc68cfbc2251be9d4d_f4d6532a"}
# Setting CACHEUPLOAD to 1 will also disable pulling from DLRN current
export CACHEUPLOAD=${CACHEUPLOAD:-"1"}
CURRENT_DIR=$(dirname $0)
sudo setenforce 0
sudo sed -i "s/enforcing/permissive/" /etc/selinux/config
sudo mkdir -p /opt/cinder-standalone
sudo chown -R $USER: /opt/cinder-standalone
sudo yum -y install git
if [ ! -d /opt/cinder-standalone/tripleo-ci ]; then
git clone https://github.com/openstack-infra/tripleo-ci.git \
/opt/cinder-standalone/tripleo-ci
fi
# Repository setup
# Only run it if not already done since it is time consuming
if [ ! -f /etc/yum.repos.d/delorean.repo ]; then
/opt/cinder-standalone/tripleo-ci/scripts/tripleo.sh --repo-setup
fi
# Install initial packages
sudo yum -y install python-tripleoclient docker
# journald must be running for docker
sudo systemctl start systemd-journald
sudo systemctl enable systemd-journald
sudo systemctl start docker
sudo systemctl enable docker
# Symlink all puppet modules
sudo ln -s -f /usr/share/openstack-puppet/modules/* /etc/puppet/modules
# Clone patched puppet-cinder
sudo rm -rf /usr/share/openstack-puppet/modules/cinder
sudo git clone https://github.com/splitwood/puppet-cinder.git /usr/share/openstack-puppet/modules/cinder
# Clone patched tripleo-heat-templates
if [ ! -d /opt/cinder-standalone/tripleo-heat-templates ]; then
git clone https://github.com/splitwood/tripleo-heat-templates.git \
/opt/cinder-standalone/tripleo-heat-templates
fi
# Generate docker registry environment
if [ ! -f $HOME/docker_registry.yaml ]; then
openstack overcloud container image prepare \
--namespace tripleoupstream \
--tag latest \
--images-file overcloud_conatiners.yaml \
--env-file $HOME/docker_registry.yaml
fi
LOCAL_IP=${LOCAL_IP:-`/usr/sbin/ip -4 route get 8.8.8.8 | awk {'print $7'} | tr -d '\n'`}
EXTRA_ENVS=${EXTRA_ENVS:-""}
if [ -d $HOME/custom-environments ]; then
for f in $HOME/custom-environments/*; do
[ -f "$f" ] || continue
EXTRA_ENVS="$EXTRA_ENVS -e $f";
done
fi
time sudo openstack undercloud deploy \
--templates=/opt/cinder-standalone/tripleo-heat-templates \
--local-ip=$LOCAL_IP \
--keep-running \
-e /opt/cinder-standalone/tripleo-heat-templates/environments/services-docker/ironic.yaml \
-e /opt/cinder-standalone/tripleo-heat-templates/environments/services-docker/mistral.yaml \
-e /opt/cinder-standalone/tripleo-heat-templates/environments/services-docker/zaqar.yaml \
-e /opt/cinder-standalone/tripleo-heat-templates/environments/docker.yaml \
-e /opt/cinder-standalone/tripleo-heat-templates/environments/mongodb-nojournal.yaml \
-e $HOME/docker_registry.yaml \
-e $CURRENT_DIR/environments/cinder-standalone.yaml \
$EXTRA_ENVS \
$@