diff options
author | 2017-03-21 22:34:52 +0100 | |
---|---|---|
committer | 2017-03-22 10:12:59 +0000 | |
commit | 94015c8da50dc231942e3a237652f92d0bc3de3d (patch) | |
tree | 2b3bb41ef987cebdc9db4232344b255ae4d24594 /prototypes/openstack-ansible/scripts | |
parent | 02dedae8348cd88f80b0ccae867572171e52f3bc (diff) |
xci: Updates to releng/osa to make it work on Jenkins
- change OSA_BRANCH to OPENSTACK_BRANCH to be consistent everywhere.
- create opnfv-setup-openstack.yml playbook, getting rid of some components
and copy it to xcimaster to use during the deployment.
- switch to opnfv-setup-openstack.yml from setup-openstack.yml.
- create Jenkins job wrapper to execute osa deploy script.
- disable ansible strict host key checking.
- use sudo -E as needed in order to make env vars set by Jenkins
job and wrapper available to other scripts and to ansible.
- rename jumphost to xcimaster so people do not mix it with actual
jumphost located in Pharos PODs.
- other minor fixes.
Change-Id: I5736fa700c2aa39c598d301bc74450d766b74411
Signed-off-by: Fatih Degirmenci <fatih.degirmenci@ericsson.com>
Diffstat (limited to 'prototypes/openstack-ansible/scripts')
-rwxr-xr-x | prototypes/openstack-ansible/scripts/osa_deploy.sh | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/prototypes/openstack-ansible/scripts/osa_deploy.sh b/prototypes/openstack-ansible/scripts/osa_deploy.sh index 79625d211..afc8368b1 100755 --- a/prototypes/openstack-ansible/scripts/osa_deploy.sh +++ b/prototypes/openstack-ansible/scripts/osa_deploy.sh @@ -3,27 +3,27 @@ export OSA_PATH=/opt/openstack-ansible export LOG_PATH=$OSA_PATH/log export PLAYBOOK_PATH=$OSA_PATH/playbooks -export OSA_BRANCH=${OSA_BRANCH:-"master"} -JUMPHOST_IP="192.168.122.2" +export OPENSTACK_BRANCH=${OPENSTACK_BRANCH:-"master"} +XCIMASTER_IP="192.168.122.2" sudo /bin/rm -rf $LOG_PATH sudo /bin/mkdir -p $LOG_PATH sudo /bin/cp /root/.ssh/id_rsa.pub ../file/authorized_keys -sudo echo -e '\n'>>../file/authorized_keys +echo -e '\n' | sudo tee --append ../file/authorized_keys cd ../playbooks/ # this will prepare the jump host # git clone the Openstack-Ansible, bootstrap and configure network -sudo ansible-playbook -i inventory jumphost_configuration.yml -vvv +sudo -E ansible-playbook -i inventory jumphost_configuration.yml # this will prepare the target host # such as configure network and NFS -sudo ansible-playbook -i inventory targethost_configuration.yml +sudo -E ansible-playbook -i inventory targethost_configuration.yml # using OpenStack-Ansible deploy the OpenStack echo "set UP Host !" -sudo /bin/sh -c "ssh root@$JUMPHOST_IP openstack-ansible \ +sudo -E /bin/sh -c "ssh root@$XCIMASTER_IP openstack-ansible \ $PLAYBOOK_PATH/setup-hosts.yml" | \ tee $LOG_PATH/setup-host.log @@ -39,7 +39,7 @@ else fi echo "Set UP Infrastructure !" -sudo /bin/sh -c "ssh root@$JUMPHOST_IP openstack-ansible \ +sudo -E /bin/sh -c "ssh root@$XCIMASTER_IP openstack-ansible \ $PLAYBOOK_PATH/setup-infrastructure.yml" | \ tee $LOG_PATH/setup-infrastructure.log @@ -52,7 +52,7 @@ else echo "setup infrastructure successfully!" fi -sudo /bin/sh -c "ssh root@$JUMPHOST_IP ansible -i $PLAYBOOK_PATH/inventory/ \ +sudo -E /bin/sh -c "ssh root@$XCIMASTER_IP ansible -i $PLAYBOOK_PATH/inventory/ \ galera_container -m shell \ -a "mysql -h localhost -e 'show status like \"%wsrep_cluster_%\";'"" \ | tee $LOG_PATH/galera.log @@ -66,12 +66,12 @@ else fi echo "Set UP OpenStack !" -sudo /bin/sh -c "ssh root@$JUMPHOST_IP openstack-ansible \ - $PLAYBOOK_PATH/setup-openstack.yml" | \ - tee $LOG_PATH/setup-openstack.log +sudo -E /bin/sh -c "ssh root@$XCIMASTER_IP openstack-ansible \ + $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 +grep "failed=1" $LOG_PATH/opnfv-setup-openstack.log>/dev/null \ + || grep "unreachable=1" $LOG_PATH/opnfv-setup-openstack.log>/dev/null if [ $? -eq 0 ]; then echo "failed setup openstack!" exit 1 |