tripleo-ci/scripts/bootstrap-overcloud-full-minimal.sh
Marios Andreou 5b55fbbd57 Soften guard for ceph loop device in ci script so we can move it
As part of [1] we want to drop tripleo.sh --bootstrap-subnodes
from the ci scripts and move to ansible. For zuul v3 jobs we do
that in [2].

For "legacy" and rdo jobs the equivalent change is spread at [3]
and [4]. We can't merge [3] however because it would create the
loop device and so cause the exit being removed in this review
to fail the jobs

Thus we need to soften this guard here and log a warning. Once
this merges first, we can then merge [3] and then [4]

[1] https://trello.com/c/lrSUMaqw/885-translate-tripleosh-bootstrap-subnodes-into-a-series-of-tasks-s17
[2] https://review.openstack.org/#/c/583195/
[3] https://review.rdoproject.org/r/#/c/15000/
[4] https://review.openstack.org/#/c/587012/

Change-Id: Id69c3148bd077e338ef29b9bf8edc57fa2581699
2018-07-31 16:56:39 +03:00

57 lines
2.1 KiB
Bash
Executable File

#!/bin/bash
set -eux
export STABLE_RELEASE=${STABLE_RELEASE:-""}
# Source deploy.env if it exists. It should exist if we are running under
# tripleo-ci
export TRIPLEO_ROOT=${TRIPLEO_ROOT:-"/opt/stack/new"}
if [ -f "$TRIPLEO_ROOT/tripleo-ci/deploy.env" ]; then
source $TRIPLEO_ROOT/tripleo-ci/deploy.env
fi
# Ensure epel-release is not installed
sudo yum erase -y epel-release || :
# Copied from toci_gate_test.sh...need to apply this fix on subnodes as well
# TODO(pabelanger): Why is python-requests installed from pip?
# TODO(amoralej): remove after https://review.openstack.org/#/c/468872/ is merged
sudo pip uninstall certifi -y || true
sudo pip uninstall urllib3 -y || true
sudo pip uninstall requests -y || true
sudo rpm -e --nodeps python2-certifi || :
sudo rpm -e --nodeps python2-urllib3 || :
sudo rpm -e --nodeps python2-requests || :
sudo yum -y install python-requests python-urllib3
# Clear out any puppet modules on the node placed their by infra configuration
sudo rm -rf /etc/puppet/modules/*
# This will remove any puppet configuration done my infra setup
sudo yum -y remove puppet facter hiera
# Update everything
sudo yum -y update
# git is needed since oooq multinode jobs does a git clone
# See https://bugs.launchpad.net/tripleo-quickstart/+bug/1667043
sudo yum -y install git python-heat-agent* openstack-heat-agents
# create a loop device for ceph-ansible
# device name is static so we know what to point to from ceph-ansible
# job names might change, but multinode implies ceph as per scenario001-multinode.yaml
if [[ "${TOCI_JOBTYPE:-''}" =~ multinode ]]; then
if [[ ! -e /dev/loop3 ]]; then # ensure /dev/loop3 does not exist before making it
command -v losetup >/dev/null 2>&1 || { sudo yum -y install util-linux; }
sudo dd if=/dev/zero of=/var/lib/ceph-osd.img bs=1 count=0 seek=7G
sudo losetup /dev/loop3 /var/lib/ceph-osd.img
elif [[ -f /var/lib/ceph-osd.img ]]; then #loop3 and ceph-osd.img exist
echo "warning: looks like ceph loop device already created. Trying to continue"
else
echo "error: /dev/loop3 exists but not /var/lib/ceph-osd.img. Exiting."
exit 1
fi
sudo lsblk
fi