summaryrefslogtreecommitdiffstats
path: root/openstack-ansible
diff options
context:
space:
mode:
authorFatih Degirmenci <fatih.degirmenci@ericsson.com>2017-03-22 13:43:00 +0100
committerTrevor Bramwell <tbramwell@linuxfoundation.org>2017-08-11 12:56:12 -0700
commit9c10611b116547df395c65e16a520d42959c1eb5 (patch)
treec4be60f27bd062276dd06788bb86707814fcc2ef /openstack-ansible
parentd4e8e1e873a4eee3e45b6b357b1afd4a6dff8443 (diff)
xci: Fix grep, switch to opnfv playbook and log playbooks to console
Change-Id: I4a576d45b71267f672e55c93e4f0c95410af019a Signed-off-by: Fatih Degirmenci <fatih.degirmenci@ericsson.com>
Diffstat (limited to 'openstack-ansible')
-rwxr-xr-xopenstack-ansible/scripts/osa-deploy.sh39
1 files changed, 21 insertions, 18 deletions
diff --git a/openstack-ansible/scripts/osa-deploy.sh b/openstack-ansible/scripts/osa-deploy.sh
index d30cf1b7..ec607443 100755
--- a/openstack-ansible/scripts/osa-deploy.sh
+++ b/openstack-ansible/scripts/osa-deploy.sh
@@ -29,6 +29,7 @@ echo "* *"
echo "* Configure XCI Master *"
echo "* *"
echo "* Bootstrap xci-master, configure network, clone openstack-ansible *"
+echo "* Playbooks: configure-xcimaster.yml *"
echo "* *"
echo "***********************************************************************"
echo -e "\n"
@@ -36,6 +37,7 @@ echo -e "\n"
cd ../playbooks/
# this will prepare the jump host
# git clone the Openstack-Ansible, bootstrap and configure network
+echo "xci: running ansible playbook configure-xcimaster.yml"
sudo -E ansible-playbook -i inventory configure-xcimaster.yml
echo "XCI Master is configured successfully!"
@@ -47,12 +49,14 @@ echo "* *"
echo "* Configure Nodes *"
echo "* *"
echo "* Configure network on OpenStack Nodes, configure NFS *"
+echo "* Playbooks: configure-targethosts.yml *"
echo "* *"
echo "***********************************************************************"
echo -e "\n"
# this will prepare the target host
# such as configure network and NFS
+echo "xci: running ansible playbook configure-targethosts.yml"
sudo -E ansible-playbook -i inventory configure-targethosts.yml
echo "Nodes are configured successfully!"
@@ -64,33 +68,33 @@ echo "* *"
echo "* Set Up OpenStack Nodes *"
echo "* *"
echo "* Set up OpenStack Nodes using openstack-ansible *"
+echo "* Playbooks: setup-hosts.yml, setup-infrastructure.yml *"
echo "* *"
echo "***********************************************************************"
echo -e "\n"
# using OpenStack-Ansible deploy the OpenStack
-
+echo "xci: running ansible playbook setup-hosts.yml"
sudo -E /bin/sh -c "ssh root@$XCIMASTER_IP openstack-ansible \
$PLAYBOOK_PATH/setup-hosts.yml" | \
- tee $LOG_PATH/setup-host.log
+ tee $LOG_PATH/setup-hosts.log
-#check the result of openstack-ansible setup-hosts.yml
-#if failed, exit with exit code 1
-grep "failed=1" $LOG_PATH/setup-host.log>/dev/null \
- || grep "unreachable=1" $LOG_PATH/setup-host.log>/dev/null
-if [ $? -eq 0 ]; then
+# check the result of openstack-ansible setup-hosts.yml
+# if failed, exit with exit code 1
+if grep -q 'failed=1\|unreachable=1' $LOG_PATH/setup-hosts.log; then
echo "OpenStack node setup failed!"
exit 1
fi
+echo "xci: running ansible playbook setup-infrastructure.yml"
sudo -E /bin/sh -c "ssh root@$XCIMASTER_IP openstack-ansible \
$PLAYBOOK_PATH/setup-infrastructure.yml" | \
tee $LOG_PATH/setup-infrastructure.log
-grep "failed=1" $LOG_PATH/setup-infrastructure.log>/dev/null \
- || grep "unreachable=1" $LOG_PATH/setup-infrastructure.log>/dev/null
-if [ $? -eq 0 ]; then
- echo "failed setup infrastructure!"
+# check the result of openstack-ansible setup-infrastructure.yml
+# if failed, exit with exit code 1
+if grep -q 'failed=1\|unreachable=1' $LOG_PATH/setup-infrastructure.log; then
+ echo "OpenStack node setup failed!"
exit 1
fi
@@ -101,8 +105,7 @@ sudo -E /bin/sh -c "ssh root@$XCIMASTER_IP ansible -i $PLAYBOOK_PATH/inventory/
-a "mysql -h localhost -e 'show status like \"%wsrep_cluster_%\";'"" \
| tee $LOG_PATH/galera.log
-grep "FAILED" $LOG_PATH/galera.log>/dev/null
-if [ $? -eq 0 ]; then
+if grep -q 'FAILED' $LOG_PATH/galera.log; then
echo "Database cluster verification failed!"
exit 1
else
@@ -114,17 +117,17 @@ echo -e "\n"
echo "***********************************************************************"
echo "* *"
echo "* Install OpenStack *"
+echo "* Playbooks: opnfv-setup-openstack.yml *"
echo "* *"
echo "***********************************************************************"
echo -e "\n"
+echo "xci: running ansible playbook opnfv-setup-openstack.yml"
sudo -E /bin/sh -c "ssh root@$XCIMASTER_IP openstack-ansible \
- $PLAYBOOK_PATH/setup-openstack.yml" | \
- tee $LOG_PATH/setup-openstack.log
+ $PLAYBOOK_PATH/opnfv-setup-openstack.yml" | \
+ tee $LOG_PATH/opnfv-setup-openstack.log
-grep "failed=1" $LOG_PATH/setup-openstack.log>/dev/null \
- || grep "unreachable=1" $LOG_PATH/setup-openstack.log>/dev/null
-if [ $? -eq 0 ]; then
+if grep -q 'failed=1\|unreachable=1' $LOG_PATH/opnfv-setup-openstack.log; then
echo "OpenStack installation failed!"
exit 1
else