bifrost/scripts/test-bifrost.sh
Julia Kreger 48b4d6abfe Lock Bifrost to Ansible stable-1.9
Due to a change landing in Ansible devel branch, we need to lock
the version to stable-1.9.

Update modules to explicitly define auth_type for compatability with
Ansible 1.9.

This change superceeds: I6dc3842bda19234921cd10fc5836ef8cfdcabb82

Ansible bug: https://github.com/ansible/ansible/issues/11119

Change-Id: Id4002fd95c09cb765ef9268c8ee35f1d9ce90107
Partial-Bug: #1461025
2015-06-02 20:28:05 -04:00

51 lines
1.4 KiB
Bash
Executable File

#!/bin/bash
set -eux
set -o pipefail
export PYTHONUNBUFFERED=1
SCRIPT_HOME=$(dirname $0)
BIFROST_HOME=$SCRIPT_HOME/..
# Install Ansible
$SCRIPT_HOME/env-setup.sh
# Source Ansible
# NOTE(TheJulia): Ansible stable-1.9 source method tosses an error deep
# under the hood which -x will detect, so for this step, we need to suspend
# and then re-enable the feature.
set +x
source /opt/stack/ansible/hacking/env-setup
set -x
# Change working directory
cd $BIFROST_HOME/playbooks
# Perform a syntax check
ansible-playbook -vvvv -i inventory/localhost test-bifrost.yaml --syntax-check --list-tasks
set +e
# Execute test playbook
ansible-playbook -vvvv -i inventory/localhost test-bifrost.yaml -e use_cirros=true -e testing_user=cirros
EXITCODE=$?
if [ $EXITCODE != 0 ]; then
echo "*************************"
echo "Test failed. Test VM log:"
sudo cat /var/log/libvirt/baremetal_logs/testvm1_console.log
echo "*************************"
echo "Kernel log:"
sudo dmesg
echo "*************************"
echo "Network Sockets in LISTEN state:"
sudo netstat -apn|grep LISTEN
echo "*************************"
echo "Firewalling settings:"
sudo iptables -L -n -v
echo "*************************"
echo "Ironic API log, last 1000 lines:"
sudo cat /var/log/upstart/ironic-api.log
echo "*************************"
echo "Ironic Conductor log, last 1000 lines:"
sudo cat /var/log/upstart/ironic-conductor.log
fi
exit $EXITCODE