diff options
17 files changed, 344 insertions, 125 deletions
diff --git a/jjb/joid/joid-daily-jobs.yml b/jjb/joid/joid-daily-jobs.yml index 8c69c8310..ec6c868c9 100644 --- a/jjb/joid/joid-daily-jobs.yml +++ b/jjb/joid/joid-daily-jobs.yml @@ -163,17 +163,17 @@ # i.e. one tempest smoke ipv6, two vping from functest) # 4.not used for release criteria or compliance, # only to debug the dovetail tool bugs with joid - - trigger-builds: - - project: 'dovetail-joid-{pod}-debug-{stream}' - current-parameters: false - predefined-parameters: - DEPLOY_SCENARIO={scenario} - block: true - same-node: true - block-thresholds: - build-step-failure-threshold: 'never' - failure-threshold: 'never' - unstable-threshold: 'FAILURE' + #- trigger-builds: + # - project: 'dovetail-joid-{pod}-debug-{stream}' + # current-parameters: false + # predefined-parameters: + # DEPLOY_SCENARIO={scenario} + # block: true + # same-node: true + # block-thresholds: + # build-step-failure-threshold: 'never' + # failure-threshold: 'never' + # unstable-threshold: 'FAILURE' - job-template: name: 'joid-deploy-{pod}-daily-{stream}' diff --git a/jjb/opnfvdocs/opnfvdocs.yml b/jjb/opnfvdocs/opnfvdocs.yml index 0553cd436..fc825ff64 100644 --- a/jjb/opnfvdocs/opnfvdocs.yml +++ b/jjb/opnfvdocs/opnfvdocs.yml @@ -8,8 +8,8 @@ project: '{name}' jobs: - - 'opnfvdocs-verify-{stream}' - - 'opnfvdocs-merge-{stream}' + - 'opnfvdocs-verify-shellcheck-{stream}' + - 'opnfvdocs-merge-shellcheck-{stream}' - 'opnfvdocs-daily-{stream}' stream: @@ -27,7 +27,7 @@ ######################## - job-template: - name: 'opnfvdocs-verify-{stream}' + name: 'opnfvdocs-verify-shellcheck-{stream}' disabled: '{obj:disabled}' @@ -72,7 +72,7 @@ - check-bash-syntax - job-template: - name: 'opnfvdocs-merge-{stream}' + name: 'opnfvdocs-merge-shellcheck-{stream}' disabled: '{obj:disabled}' diff --git a/jjb/xci/bifrost-verify.sh b/jjb/xci/bifrost-verify.sh index e0c50907a..762466825 100755 --- a/jjb/xci/bifrost-verify.sh +++ b/jjb/xci/bifrost-verify.sh @@ -115,7 +115,7 @@ sudo /bin/cp -rf /opt/releng/prototypes/bifrost/* /opt/bifrost/ cd /opt/bifrost sudo -E ./scripts/destroy-env.sh -# provision 3 VMs; jumphost, controller, and compute +# provision 3 VMs; xcimaster, controller, and compute cd /opt/bifrost sudo -E ./scripts/test-bifrost-deployment.sh diff --git a/jjb/xci/xci-daily-jobs.yml b/jjb/xci/xci-daily-jobs.yml index c685aa974..65da308ae 100644 --- a/jjb/xci/xci-daily-jobs.yml +++ b/jjb/xci/xci-daily-jobs.yml @@ -78,12 +78,12 @@ concurrent: false properties: - - logrotate-default - build-blocker: use-build-blocker: true blocking-jobs: - - 'xci-os-.*?-{pod}-daily-.*' + - '^xci-os.*' block-level: 'NODE' + - logrotate-default parameters: - string: @@ -137,14 +137,14 @@ concurrent: false properties: - - logrotate-default - build-blocker: use-build-blocker: true blocking-jobs: - - 'xci-provision-.*?-{pod}-daily-.*' - - 'xci-deploy-.*?-{pod}-daily-.*' - - 'xci-functest-.*?-{pod}-daily-.*' + - '^xci-provision.*' + - '^xci-deploy.*' + - '^xci-functest.*' block-level: 'NODE' + - logrotate-default parameters: - string: @@ -177,6 +177,9 @@ - string: name: CLEAN_DIB_IMAGES default: 'true' + - label: + name: SLAVE_LABEL + default: '{slave-label}' builders: - description-setter: diff --git a/jjb/xci/xci-deploy.sh b/jjb/xci/xci-deploy.sh index b97b24e47..dae67cf84 100755 --- a/jjb/xci/xci-deploy.sh +++ b/jjb/xci/xci-deploy.sh @@ -1,3 +1,70 @@ #!/bin/bash +# SPDX-license-identifier: Apache-2.0 +############################################################################## +# Copyright (c) 2016 Ericsson AB and others. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## +set -o errexit +set -o nounset +set -o pipefail -echo "Deployment via openstack-ansible" +trap cleanup_and_upload EXIT + +function fix_ownership() { + if [ -z "${JOB_URL+x}" ]; then + echo "Not running as part of Jenkins. Handle the logs manually." + else + # Make sure cache exists + [[ ! -d ${HOME}/.cache ]] && mkdir ${HOME}/.cache + + sudo chown -R jenkins:jenkins $WORKSPACE + sudo chown -R jenkins:jenkins ${HOME}/.cache + fi +} + +function cleanup_and_upload() { + original_exit=$? + fix_ownership + exit $original_exit +} + +# check distro to see if we support it +if [[ ! "$DISTRO" =~ (xenial|centos7|suse) ]]; then + echo "Distro $DISTRO is not supported!" + exit 1 +fi + +# remove previously cloned repos +sudo /bin/rm -rf /opt/openstack-ansible /opt/stack /opt/releng /opt/functest + +# Fix up permissions +fix_ownership + +# openstack-ansible enables strict host key checking by default +export ANSIBLE_HOST_KEY_CHECKING=False + +# display the nodes +cd /opt/bifrost +source env-vars +ironic node-list +virsh list + +# ensure the branches to use are set +export OPNFV_BRANCH=${OPNFV_BRANCH:-master} +export OPENSTACK_BRANCH=${OPENSTACK_BRANCH:-master} + +# clone releng repo +sudo git clone -b $OPNFV_BRANCH https://gerrit.opnfv.org/gerrit/releng /opt/releng + +# this script will be reused for promoting openstack-ansible versions and using +# promoted openstack-ansible versions as part of xci daily. +USE_PROMOTED_VERSIONS=${USE_PROMOTED_VERSIONS:-false} +if [ $USE_PROMOTED_VERSIONS = "true" ]; then + echo "TBD: Will use the promoted versions of openstack/opnfv projects" +fi + +cd /opt/releng/prototypes/openstack-ansible/scripts +sudo -E ./osa-deploy.sh diff --git a/jjb/xci/xci-provision.sh b/jjb/xci/xci-provision.sh index 4308c7ef8..e474093b8 100755 --- a/jjb/xci/xci-provision.sh +++ b/jjb/xci/xci-provision.sh @@ -43,9 +43,9 @@ sudo /bin/rm -rf /opt/bifrost /opt/openstack-ansible /opt/stack /opt/releng /opt # Fix up permissions fix_ownership -# clone all the repos first and checkout the patch afterwards -OPENSTACK_BRANCH=${OPENSTACK_BRANCH:-master} -OPNFV_BRANCH=${OPNFV_BRANCH:-master} +# ensure the branches to use are set +export OPENSTACK_BRANCH=${OPENSTACK_BRANCH:-master} +export OPNFV_BRANCH=${OPNFV_BRANCH:-master} sudo git clone -b $OPENSTACK_BRANCH https://git.openstack.org/openstack/bifrost /opt/bifrost sudo git clone -b $OPNFV_BRANCH https://gerrit.opnfv.org/gerrit/releng /opt/releng @@ -63,7 +63,7 @@ sudo /bin/cp -rf /opt/releng/prototypes/bifrost/* /opt/bifrost/ cd /opt/bifrost sudo -E ./scripts/destroy-env.sh -# provision 6 VMs; jumphost, controller00, controller01, controller02, compute00, and compute01 +# provision 6 VMs; xcimaster, controller00, controller01, controller02, compute00, and compute01 cd /opt/bifrost sudo -E ./scripts/osa-bifrost-deployment.sh diff --git a/prototypes/bifrost/README.md b/prototypes/bifrost/README.md index 0ba49d46d..dc1417a86 100644 --- a/prototypes/bifrost/README.md +++ b/prototypes/bifrost/README.md @@ -31,7 +31,7 @@ Please follow that steps: cd /opt/bifrost sudo ./scripts/destroy-env.sh -8. Run deployment script to spin up 3 vms with bifrost: jumphost, controller and compute:: +8. Run deployment script to spin up 3 vms with bifrost: xcimaster, controller and compute:: cd /opt/bifrost sudo ./scripts/test-bifrost-deployment.sh diff --git a/prototypes/bifrost/playbooks/inventory/group_vars/baremetal b/prototypes/bifrost/playbooks/inventory/group_vars/baremetal new file mode 100644 index 000000000..008b04d11 --- /dev/null +++ b/prototypes/bifrost/playbooks/inventory/group_vars/baremetal @@ -0,0 +1,53 @@ +--- +# The ironic API URL for bifrost operations. Defaults to localhost. +# ironic_url: "http://localhost:6385/" + +# The network interface that bifrost will be operating on. Defaults +# to virbr0 in roles, can be overridden here. +# network_interface: "virbr0" + +# The path to the SSH key to be utilized for testing and burn-in +# to configuration drives. When set, it should be set in both baremetal +# and localhost groups, however this is only an override to the default. + +# workaround for opnfv ci until we can fix non-root use +ssh_public_key_path: "/root/.ssh/id_rsa.pub" + +# Normally this user should be root, however if cirros is used, +# a user may wish to define a specific user for testing VM +# connectivity during a test sequence +testing_user: root + +# The default port to download files via. Required for IPA URL generation. +# Presently the defaults are located in the roles, however if changed both +# the localhost and baremetal group files must be updated. +# file_url_port: 8080 + +# IPA Image parameters. If these are changed, they must be changed in +# Both localhost and baremetal groups. Presently the defaults +# in each role should be sufficent for proper operation. +# ipa_kernel: "{{http_boot_folder}}/coreos_production_pxe.vmlinuz" +# ipa_ramdisk: "{{http_boot_folder}}/coreos_production_pxe_image-oem.cpio.gz" +# ipa_kernel_url: "http://{{ hostvars[inventory_hostname]['ansible_' + network_interface]['ipv4']['address'] }}:{{file_url_port}}/coreos_production_pxe.vmlinuz" +# ipa_ramdisk_url: "http://{{ hostvars[inventory_hostname]['ansible_' + network_interface]['ipv4']['address'] }}:{{file_url_port}}/coreos_production_pxe_image-oem.cpio.gz" + +# The http_boot_folder defines the root folder for the webserver. +# If this setting is changed, it must be applied to both the baremetal +# and localhost groups. Presently the role defaults are set to the value +# below. +# http_boot_folder: /httpboot + +# The settings for the name of the image to be deployed along with the +# on disk location are below. If changed, these settings must be applied +# to both the baremetal and localhost groups. If the file is already on +# disk, then the image generation will not take place, otherwise an image +# will be generated using diskimage-builder. +# deploy_image_filename: "deployment_image.qcow2" +# deploy_image: "{{http_boot_folder}}/{{deploy_image_filename}}" + +# Under normal circumstances, the os_ironic_node module does not wait for +# the node to reach active state before continuing with the deployment +# process. This means we may have to timeout, to figure out a deployment +# failed. Change wait_for_node_deploy to true to cause bifrost to wait for +# Ironic to show the instance in Active state. +wait_for_node_deploy: false diff --git a/prototypes/bifrost/scripts/osa-bifrost-deployment.sh b/prototypes/bifrost/scripts/osa-bifrost-deployment.sh index c92bd9d4e..33ad10887 100755 --- a/prototypes/bifrost/scripts/osa-bifrost-deployment.sh +++ b/prototypes/bifrost/scripts/osa-bifrost-deployment.sh @@ -18,10 +18,18 @@ ENABLE_VENV="false" USE_DHCP="false" USE_VENV="false" BUILD_IMAGE=true -export BAREMETAL_DATA_FILE=${BAREMETAL_DATA_FILE:-'/tmp/baremetal.json'} -export BIFROST_INVENTORY_SOURCE=${BIFROST_INVENTORY_SOURCE:-'/tmp/baremetal.csv'} PROVISION_WAIT_TIMEOUT=${PROVISION_WAIT_TIMEOUT:-3600} +# ensure the branch is set +export OPENSTACK_BRANCH=${OPENSTACK_BRANCH:-master} + +# ensure the right inventory files is used based on branch +if [ $OPENSTACK_BRANCH = "master" ]; then + export BIFROST_INVENTORY_SOURCE=${BIFROST_INVENTORY_SOURCE:-'/tmp/baremetal.json'} +else + export BIFROST_INVENTORY_SOURCE=${BIFROST_INVENTORY_SOURCE:-'/tmp/baremetal.csv'} +fi + # Set defaults for ansible command-line options to drive the different # tests. @@ -34,7 +42,7 @@ PROVISION_WAIT_TIMEOUT=${PROVISION_WAIT_TIMEOUT:-3600} # use cirros. TEST_VM_NUM_NODES=6 -export TEST_VM_NODE_NAMES="jumphost controller00 controller01 controller02 compute00 compute01" +export TEST_VM_NODE_NAMES="xcimaster controller00 controller01 controller02 compute00 compute01" export VM_DOMAIN_TYPE="kvm" # 8 vCPU, 60 GB HDD are minimum equipment export VM_CPU=${VM_CPU:-8} @@ -107,8 +115,7 @@ ${ANSIBLE} \ -e test_vm_num_nodes=${TEST_VM_NUM_NODES} \ -e test_vm_memory_size=${VM_MEMORY_SIZE} \ -e enable_venv=${ENABLE_VENV} \ - -e test_vm_domain_type=${VM_DOMAIN_TYPE} \ - -e baremetal_json_file=${BAREMETAL_DATA_FILE} + -e test_vm_domain_type=${VM_DOMAIN_TYPE} # Execute the installation and VM startup test. ${ANSIBLE} \ diff --git a/prototypes/bifrost/scripts/test-bifrost-deployment.sh b/prototypes/bifrost/scripts/test-bifrost-deployment.sh index 2e33bc164..83cf1cc1b 100755 --- a/prototypes/bifrost/scripts/test-bifrost-deployment.sh +++ b/prototypes/bifrost/scripts/test-bifrost-deployment.sh @@ -18,9 +18,8 @@ ENABLE_VENV="false" USE_DHCP="false" USE_VENV="false" BUILD_IMAGE=true -export BAREMETAL_DATA_FILE=${BAREMETAL_DATA_FILE:-'/tmp/baremetal.json'} -export BIFROST_INVENTORY_SOURCE=${BIFROST_INVENTORY_SOURCE:-'/tmp/baremetal.csv'} PROVISION_WAIT_TIMEOUT=${PROVISION_WAIT_TIMEOUT:-3600} +BAREMETAL_DATA_FILE=${BAREMETAL_DATA_FILE:-'/tmp/baremetal.json'} # Set defaults for ansible command-line options to drive the different # tests. @@ -34,7 +33,7 @@ PROVISION_WAIT_TIMEOUT=${PROVISION_WAIT_TIMEOUT:-3600} # use cirros. TEST_VM_NUM_NODES=3 -export TEST_VM_NODE_NAMES="jumphost.opnfvlocal controller00.opnfvlocal compute00.opnfvlocal" +export TEST_VM_NODE_NAMES="xcimaster controller00 compute00" export VM_DOMAIN_TYPE="kvm" export VM_CPU=${VM_CPU:-4} export VM_DISK=${VM_DISK:-100} diff --git a/prototypes/openstack-ansible/file/opnfv-setup-openstack.yml b/prototypes/openstack-ansible/file/opnfv-setup-openstack.yml new file mode 100644 index 000000000..aacdeffb0 --- /dev/null +++ b/prototypes/openstack-ansible/file/opnfv-setup-openstack.yml @@ -0,0 +1,34 @@ +--- +# Copyright 2014, Rackspace US, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +- include: os-keystone-install.yml +- include: os-glance-install.yml +- include: os-cinder-install.yml +- include: os-nova-install.yml +- include: os-neutron-install.yml +- include: os-heat-install.yml +- include: os-horizon-install.yml +- include: os-ceilometer-install.yml +- include: os-aodh-install.yml +#NOTE(stevelle) Ensure Gnocchi identities exist before Swift +- include: os-gnocchi-install.yml + when: + - gnocchi_storage_driver is defined + - gnocchi_storage_driver == 'swift' + vars: + gnocchi_identity_only: True +- include: os-swift-install.yml +- include: os-gnocchi-install.yml +- include: os-ironic-install.yml diff --git a/prototypes/openstack-ansible/playbooks/targethost_configuration.yml b/prototypes/openstack-ansible/playbooks/configure-targethosts.yml index 1f4ad063e..1f4ad063e 100644 --- a/prototypes/openstack-ansible/playbooks/targethost_configuration.yml +++ b/prototypes/openstack-ansible/playbooks/configure-targethosts.yml diff --git a/prototypes/openstack-ansible/playbooks/jumphost_configuration.yml b/prototypes/openstack-ansible/playbooks/configure-xcimaster.yml index 74e97cdd5..b6c79a418 100644 --- a/prototypes/openstack-ansible/playbooks/jumphost_configuration.yml +++ b/prototypes/openstack-ansible/playbooks/configure-xcimaster.yml @@ -1,5 +1,5 @@ --- -- hosts: jumphost +- hosts: xcimaster remote_user: root vars_files: - ../var/ubuntu.yml @@ -13,7 +13,11 @@ - name: remove the directory shell: "rm -rf {{OSA_PATH}} {{OSA_ETC_PATH}}" - name: git openstack ansible - shell: "git clone {{OSA_URL}} {{OSA_PATH}} -b {{OSA_BRANCH}}" + shell: "git clone {{OSA_URL}} {{OSA_PATH}} -b {{OPENSTACK_BRANCH}}" + - name: copy opnfv-setup-openstack.yml to /opt/openstack-ansible/playbooks + copy: + src: ../file/opnfv-setup-openstack.yml + dest: "{{OSA_PATH}}/playbooks/opnfv-setup-openstack.yml" - name: copy /opt/openstack-ansible/etc/openstack_deploy to /etc/openstack_deploy shell: "/bin/cp -rf {{OSA_PATH}}/etc/openstack_deploy {{OSA_ETC_PATH}}" - name: bootstrap @@ -50,4 +54,4 @@ remote_user: root tasks: - name: Generate authorized_keys - shell: "/bin/cat /jumphost/root/.ssh/id_rsa.pub >> ../file/authorized_keys" + shell: "/bin/cat /xcimaster/root/.ssh/id_rsa.pub >> ../file/authorized_keys" diff --git a/prototypes/openstack-ansible/playbooks/inventory b/prototypes/openstack-ansible/playbooks/inventory index f53da5305..d3768f51c 100644 --- a/prototypes/openstack-ansible/playbooks/inventory +++ b/prototypes/openstack-ansible/playbooks/inventory @@ -1,5 +1,5 @@ -[jumphost] -jumphost ansible_ssh_host=192.168.122.2 +[xcimaster] +xcimaster ansible_ssh_host=192.168.122.2 [controller] controller00 ansible_ssh_host=192.168.122.3 diff --git a/prototypes/openstack-ansible/scripts/osa-deploy.sh b/prototypes/openstack-ansible/scripts/osa-deploy.sh new file mode 100755 index 000000000..d30cf1b7b --- /dev/null +++ b/prototypes/openstack-ansible/scripts/osa-deploy.sh @@ -0,0 +1,133 @@ +#!/bin/bash +# SPDX-license-identifier: Apache-2.0 +############################################################################## +# Copyright (c) 2016 Huawei Technologies Co.,Ltd and others. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## +set -o errexit +set -o nounset +set -o pipefail + +export OSA_PATH=/opt/openstack-ansible +export LOG_PATH=$OSA_PATH/log +export PLAYBOOK_PATH=$OSA_PATH/playbooks +export OSA_BRANCH=${OSA_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 +echo -e '\n' | sudo tee --append ../file/authorized_keys + +# log some info +echo -e "\n" +echo "***********************************************************************" +echo "* *" +echo "* Configure XCI Master *" +echo "* *" +echo "* Bootstrap xci-master, configure network, clone openstack-ansible *" +echo "* *" +echo "***********************************************************************" +echo -e "\n" + +cd ../playbooks/ +# this will prepare the jump host +# git clone the Openstack-Ansible, bootstrap and configure network +sudo -E ansible-playbook -i inventory configure-xcimaster.yml + +echo "XCI Master is configured successfully!" + +# log some info +echo -e "\n" +echo "***********************************************************************" +echo "* *" +echo "* Configure Nodes *" +echo "* *" +echo "* Configure network on OpenStack Nodes, configure NFS *" +echo "* *" +echo "***********************************************************************" +echo -e "\n" + +# this will prepare the target host +# such as configure network and NFS +sudo -E ansible-playbook -i inventory configure-targethosts.yml + +echo "Nodes are configured successfully!" + +# log some info +echo -e "\n" +echo "***********************************************************************" +echo "* *" +echo "* Set Up OpenStack Nodes *" +echo "* *" +echo "* Set up OpenStack Nodes using openstack-ansible *" +echo "* *" +echo "***********************************************************************" +echo -e "\n" + +# using OpenStack-Ansible deploy the OpenStack + +sudo -E /bin/sh -c "ssh root@$XCIMASTER_IP openstack-ansible \ + $PLAYBOOK_PATH/setup-hosts.yml" | \ + tee $LOG_PATH/setup-host.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 + echo "OpenStack node setup failed!" + exit 1 +fi + +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!" + exit 1 +fi + +echo "OpenStack nodes are setup successfully!" + +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 + +grep "FAILED" $LOG_PATH/galera.log>/dev/null +if [ $? -eq 0 ]; then + echo "Database cluster verification failed!" + exit 1 +else + echo "Database cluster verification successful!" +fi + +# log some info +echo -e "\n" +echo "***********************************************************************" +echo "* *" +echo "* Install OpenStack *" +echo "* *" +echo "***********************************************************************" +echo -e "\n" + +sudo -E /bin/sh -c "ssh root@$XCIMASTER_IP openstack-ansible \ + $PLAYBOOK_PATH/setup-openstack.yml" | \ + tee $LOG_PATH/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 + echo "OpenStack installation failed!" + exit 1 +else + echo "OpenStack installation is successfully completed!" + exit 0 +fi diff --git a/prototypes/openstack-ansible/scripts/osa_deploy.sh b/prototypes/openstack-ansible/scripts/osa_deploy.sh deleted file mode 100755 index 79625d211..000000000 --- a/prototypes/openstack-ansible/scripts/osa_deploy.sh +++ /dev/null @@ -1,81 +0,0 @@ -#!/bin/bash - -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" - -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 - -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 - -# this will prepare the target host -# such as configure network and NFS -sudo 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 \ - $PLAYBOOK_PATH/setup-hosts.yml" | \ - tee $LOG_PATH/setup-host.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 - echo "failed setup host!" - exit 1 -else - echo "setup host successfully!" -fi - -echo "Set UP Infrastructure !" -sudo /bin/sh -c "ssh root@$JUMPHOST_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!" - exit 1 -else - echo "setup infrastructure successfully!" -fi - -sudo /bin/sh -c "ssh root@$JUMPHOST_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 - -grep "FAILED" $LOG_PATH/galera.log>/dev/null -if [ $? -eq 0 ]; then - echo "failed verify the database cluster!" - exit 1 -else - echo "verify the database cluster successfully!" -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 - -grep "failed=1" $LOG_PATH/setup-openstack.log>/dev/null \ - || grep "unreachable=1" $LOG_PATH/setup-openstack.log>/dev/null -if [ $? -eq 0 ]; then - echo "failed setup openstack!" - exit 1 -else - echo "OpenStack successfully deployed!" - exit 0 -fi diff --git a/prototypes/openstack-ansible/var/ubuntu.yml b/prototypes/openstack-ansible/var/ubuntu.yml index 9464384b3..321a7c4e5 100644 --- a/prototypes/openstack-ansible/var/ubuntu.yml +++ b/prototypes/openstack-ansible/var/ubuntu.yml @@ -2,7 +2,7 @@ OSA_URL: https://git.openstack.org/openstack/openstack-ansible OSA_PATH: /opt/openstack-ansible OSA_ETC_PATH: /etc/openstack_deploy -OSA_BRANCH: "{{ lookup('env','OSA_BRANCH') }}" +OPENSTACK_BRANCH: "{{ lookup('env','OPENSTACK_BRANCH') }}" -JUMPHOST_IP: 192.168.122.2 -host_info: {'jumphost':{'MGMT_IP': '172.29.236.10','VLAN_IP': '192.168.122.2', 'STORAGE_IP': '172.29.244.10'},'controller00':{'MGMT_IP': '172.29.236.11','VLAN_IP': '192.168.122.3', 'STORAGE_IP': '172.29.244.11'},'controller01':{'MGMT_IP': '172.29.236.12','VLAN_IP': '192.168.122.4', 'STORAGE_IP': '172.29.244.12'},'controller02':{'MGMT_IP': '172.29.236.13','VLAN_IP': '192.168.122.5', 'STORAGE_IP': '172.29.240.13'},'compute00':{'MGMT_IP': '172.29.236.14','VLAN_IP': '192.168.122.6','VLAN_IP_SECOND': '173.29.241.1','VXLAN_IP': '172.29.240.14', 'STORAGE_IP': '172.29.244.14'},'compute01':{'MGMT_IP': '172.29.236.15','VLAN_IP': '192.168.122.7','VLAN_IP_SECOND': '173.29.241.2','VXLAN_IP': '172.29.240.15', 'STORAGE_IP': '172.29.244.15'}} +XCIMASTER_IP: 192.168.122.2 +host_info: {'xcimaster':{'MGMT_IP': '172.29.236.10','VLAN_IP': '192.168.122.2', 'STORAGE_IP': '172.29.244.10'},'controller00':{'MGMT_IP': '172.29.236.11','VLAN_IP': '192.168.122.3', 'STORAGE_IP': '172.29.244.11'},'controller01':{'MGMT_IP': '172.29.236.12','VLAN_IP': '192.168.122.4', 'STORAGE_IP': '172.29.244.12'},'controller02':{'MGMT_IP': '172.29.236.13','VLAN_IP': '192.168.122.5', 'STORAGE_IP': '172.29.240.13'},'compute00':{'MGMT_IP': '172.29.236.14','VLAN_IP': '192.168.122.6','VLAN_IP_SECOND': '173.29.241.1','VXLAN_IP': '172.29.240.14', 'STORAGE_IP': '172.29.244.14'},'compute01':{'MGMT_IP': '172.29.236.15','VLAN_IP': '192.168.122.7','VLAN_IP_SECOND': '173.29.241.2','VXLAN_IP': '172.29.240.15', 'STORAGE_IP': '172.29.244.15'}} |