browbeat/ci-scripts/tripleo/microbrow.sh
jkilpatr c11374cca1 Move collectd into the main Ansible run for CI
This commit allows CI to run the collectd-openstack role directly
to do this I take the relevent variables from the group_vars/all.yml
and duplicate them in to the defaults. If you're not making mix and
match playbooks with browbeat roles and run the playbooks 'normally'
these defaults will never affect you in any way and will be overridden
by the group_vars/all.yml file without any interaction from you.

If on the other hand you want a playbook where you can toss collectd
install whereever you need it, this makes life much easier. Also note
that the trick I'm using to get the name of the executing hosts first
group could be used to make the collectd-openstack playbook run in
parallel across all hosts all at once rather than one group at a time.

As one final tweak this adds 10 minutesof retires to the epel install
role, specifically because two of it's tasks rely on external internet
access and fail often enough to cause trouble. Previously I would retry
the whole CollectD playbook when that happened, this is more efficient

Change-Id: Ia67ab2b4152a8d8e9f3ba1dabe1f4417d7b86233
2017-05-04 13:28:02 +00:00

94 lines
3.2 KiB
Bash
Executable File

#!/bin/bash
set -eu
pushd $WORKSPACE
pushd $WORKSPACE/tripleo-quickstart-extras
git fetch git://git.openstack.org/openstack/tripleo-quickstart-extras refs/changes/46/437946/4 && git checkout FETCH_HEAD
set +eu
source $WORKSPACE/bin/activate
pip uninstall -y tripleo-quickstart-extras
pip uninstall -y tripleo-internal-environments
set -eu
popd
popd
pushd $WORKSPACE/tripleo-quickstart
sed -i.bak '/extras/d' $WORKSPACE/tripleo-quickstart/quickstart-extras-requirements.txt
echo "file://$WORKSPACE/tripleo-quickstart-extras/#egg=tripleo-quickstart-extras" >> $WORKSPACE/tripleo-quickstart/quickstart-extras-requirements.txt
popd
export OPT_DEBUG_ANSIBLE=0
export HW_ENV_DIR=$WORKSPACE/tripleo-environments/hardware_environments/$HW_ENV
export NETWORK_ISOLATION=no_vlan
export REQS=quickstart-extras-requirements.txt
export PLAYBOOK=baremetal-virt-undercloud-tripleo-browbeat.yml
export VARS="elastic_enabled_template=true \
--extra-vars grafana_enabled_template=false \
--extra-vars elastic_host_template=$ELASTIC_HOST \
--extra-vars graphite_host=$GRAPH_HOST \
--extra-vars statsd_host=$GRAPH_HOST \
--extra-vars statsd_enabled=True \
--extra-vars grafana_host=$GRAPH_HOST \
--extra-vars grafana_username=$GRAFANA_USER \
--extra-vars grafana_password=$GRAFANA_PASS \
--extra-vars browbeat_cloud_name=$CLOUD_NAME \
--extra-vars browbeat_config_file=$BENCHMARK \
--extra-vars graphite_prefix=$CLOUD_NAME"
#For Pipeline builds we need to get the pipeline image
#we check that the pipeline image var is set and then
#configure it to be used.
if [ ! -z ${current_build+x} ]
then
source $WORKSPACE/tripleo-environments/ci-scripts/internal-functions.sh
hash=$(get_delorean_hash_from_url $current_build)
#Ocata pipeling moving to new folder structure
if [[ $RELEASE == *ocata* ]]
then
cached_image="$INTERNAL_IMAGE_SERVER/centos-org-image-cache/$RELEASE/rdo_trunk/$hash/undercloud.qcow2"
export VARS="$VARS --extra-vars undercloud_image_url=$cached_image --extra-vars dlrn_hash=$hash"
elif [[ $RELEASE == *rhos-* ]]
then
cached_image="$INTERNAL_IMAGE_SERVER/$RELEASE/$current_build/undercloud.qcow2"
export VARS="$VARS --extra-vars undercloud_image_url=$cached_image --extra-vars rhos_puddle=$current_build"
else
cached_image="$INTERNAL_IMAGE_SERVER/centos-org-image-cache/$RELEASE/delorean/$hash/undercloud.qcow2"
export VARS="$VARS --extra-vars undercloud_image_url=$cached_image --extra-vars dlrn_hash=$hash"
fi
#If we are not in the pipeline downstream builds need to use current-passed-ci
elif [[ $RELEASE == *rhos-* ]]
then
export RELEASE="$RELEASE-current-passed-ci"
fi
#used to ensure concurrent jobs on the same executor work
socketdir=$(mktemp -d /tmp/sockXXXXXX)
export ANSIBLE_SSH_CONTROL_PATH=$socketdir/%%h-%%r
pushd $WORKSPACE/tripleo-quickstart
# Solves Ansible issue 13278
sed -i '/defaults/a timeout = 60' ansible.cfg
echo "file://$WORKSPACE/browbeat/#egg=browbeat" >> $REQS
./quickstart.sh \
--playbook $PLAYBOOK \
--working-dir $WORKSPACE \
--bootstrap \
--no-clone \
-t all \
-S overcloud-validate \
-R $RELEASE \
--config $HW_ENV_DIR/network_configs/$NETWORK_ISOLATION/config_files/config.yml \
--extra-vars @$HW_ENV_DIR/network_configs/$NETWORK_ISOLATION/env_settings.yml \
--extra-vars $VARS \
$VIRTHOST