diff options
Diffstat (limited to 'xci')
-rwxr-xr-x | xci/config/env-vars | 2 | ||||
-rw-r--r-- | xci/nfvi/osa/files/ansible-role-requirements.yml (renamed from xci/file/ansible-role-requirements.yml) | 2 | ||||
-rw-r--r-- | xci/nfvi/osa/files/cinder.yml (renamed from xci/file/cinder.yml) | 0 | ||||
-rw-r--r-- | xci/nfvi/osa/files/global-requirement-pins.txt (renamed from xci/file/global-requirement-pins.txt) | 0 | ||||
-rw-r--r-- | xci/nfvi/osa/files/openstack_services.yml (renamed from xci/file/openstack_services.yml) | 0 | ||||
-rw-r--r-- | xci/nfvi/osa/files/setup-openstack.yml (renamed from xci/file/setup-openstack.yml) | 0 | ||||
-rwxr-xr-x | xci/nfvi/osa/nfvi-deploy.sh | 15 | ||||
-rw-r--r-- | xci/nfvi/osa/playbooks/bootstrap-scenarios.yml (renamed from xci/playbooks/bootstrap-scenarios.yml) | 8 | ||||
-rw-r--r-- | xci/nfvi/osa/playbooks/configure-localhost.yml (renamed from xci/playbooks/configure-localhost.yml) | 9 | ||||
-rw-r--r-- | xci/nfvi/osa/playbooks/configure-opnfvhost.yml (renamed from xci/playbooks/configure-opnfvhost.yml) | 32 | ||||
-rw-r--r-- | xci/nfvi/osa/playbooks/configure-targethosts.yml (renamed from xci/playbooks/configure-targethosts.yml) | 15 | ||||
-rw-r--r-- | xci/nfvi/osa/playbooks/inventory (renamed from xci/playbooks/inventory) | 0 | ||||
-rwxr-xr-x | xci/nfvi/osa/playbooks/xci-deploy.sh | 183 | ||||
-rw-r--r-- | xci/playbooks/get-opnfv-scenario-requirements.yml | 14 | ||||
-rw-r--r-- | xci/scenarios/os-odl-nofeature/xci_overrides | 6 | ||||
-rwxr-xr-x | xci/scripts/update-osa-version-files.sh | 14 | ||||
-rw-r--r-- | xci/var/opnfv.yml | 2 | ||||
-rwxr-xr-x | xci/xci-deploy.sh | 6 |
18 files changed, 248 insertions, 60 deletions
diff --git a/xci/config/env-vars b/xci/config/env-vars index 3777bec0..8560c996 100755 --- a/xci/config/env-vars +++ b/xci/config/env-vars @@ -33,4 +33,4 @@ export XCI_ANSIBLE_PIP_VERSION=2.3.2.0 export ANSIBLE_HOST_KEY_CHECKING=False # subject of the certificate export XCI_SSL_SUBJECT=${XCI_SSL_SUBJECT:-"/C=US/ST=California/L=San Francisco/O=IT/CN=xci.releng.opnfv.org"} -export OPNFV_SCENARIO=${OPNFV_SCENARIO:-"os-nosdn-nofeature"} +export DEPLOY_SCENARIO=${DEPLOY_SCENARIO:-"os-nosdn-nofeature"} diff --git a/xci/file/ansible-role-requirements.yml b/xci/nfvi/osa/files/ansible-role-requirements.yml index 90e40d5f..329d24a0 100644 --- a/xci/file/ansible-role-requirements.yml +++ b/xci/nfvi/osa/files/ansible-role-requirements.yml @@ -48,7 +48,7 @@ - name: lxc_hosts scm: git src: https://git.openstack.org/openstack/openstack-ansible-lxc_hosts - version: 84ac3442e542aeedf1396c88e0387b4ea1548eb1 + version: 6b529de0315fe6cd12f6e78c00a5f2f2d3a01e28 - name: memcached_server scm: git src: https://git.openstack.org/openstack/openstack-ansible-memcached_server diff --git a/xci/file/cinder.yml b/xci/nfvi/osa/files/cinder.yml index e40b3925..e40b3925 100644 --- a/xci/file/cinder.yml +++ b/xci/nfvi/osa/files/cinder.yml diff --git a/xci/file/global-requirement-pins.txt b/xci/nfvi/osa/files/global-requirement-pins.txt index aa3b1169..aa3b1169 100644 --- a/xci/file/global-requirement-pins.txt +++ b/xci/nfvi/osa/files/global-requirement-pins.txt diff --git a/xci/file/openstack_services.yml b/xci/nfvi/osa/files/openstack_services.yml index 86501634..86501634 100644 --- a/xci/file/openstack_services.yml +++ b/xci/nfvi/osa/files/openstack_services.yml diff --git a/xci/file/setup-openstack.yml b/xci/nfvi/osa/files/setup-openstack.yml index c2cb1c79..c2cb1c79 100644 --- a/xci/file/setup-openstack.yml +++ b/xci/nfvi/osa/files/setup-openstack.yml diff --git a/xci/nfvi/osa/nfvi-deploy.sh b/xci/nfvi/osa/nfvi-deploy.sh index 94e331fa..c074adde 100755 --- a/xci/nfvi/osa/nfvi-deploy.sh +++ b/xci/nfvi/osa/nfvi-deploy.sh @@ -8,6 +8,9 @@ # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## +OSA_XCI_PLAYBOOKS="$(dirname $(realpath ${BASH_SOURCE[0]}))/playbooks" +export ANSIBLE_ROLES_PATH=$HOME/.ansible/roles:/etc/ansible/roles:${XCI_PATH}/xci/playbooks/roles + if [[ ${OPENSTACK_OSA_VERSION} =~ (stable/|master) ]]; then echo "" echo "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" @@ -35,8 +38,8 @@ fi echo "Info: Configuring localhost for openstack-ansible" echo "-----------------------------------------------------------------------" -cd $XCI_PLAYBOOKS -ansible-playbook ${XCI_ANSIBLE_VERBOSITY} -i inventory configure-localhost.yml +cd $OSA_XCI_PLAYBOOKS +ansible-playbook ${XCI_ANSIBLE_VERBOSITY} -e XCI_PATH="${XCI_PATH}" -i inventory configure-localhost.yml echo "-----------------------------------------------------------------------" echo "Info: Configured localhost host for openstack-ansible" @@ -53,8 +56,8 @@ echo "Info: Configured localhost host for openstack-ansible" #------------------------------------------------------------------------------- echo "Info: Configuring opnfv deployment host for openstack-ansible" echo "-----------------------------------------------------------------------" -cd $XCI_PLAYBOOKS -ansible-playbook ${XCI_ANSIBLE_VERBOSITY} -i ${XCI_FLAVOR_ANSIBLE_FILE_PATH}/inventory \ +cd $OSA_XCI_PLAYBOOKS +ansible-playbook ${XCI_ANSIBLE_VERBOSITY} -e XCI_PATH="${XCI_PATH}" -i ${XCI_FLAVOR_ANSIBLE_FILE_PATH}/inventory \ configure-opnfvhost.yml echo "-----------------------------------------------------------------------" echo "Info: Configured opnfv deployment host for openstack-ansible" @@ -73,8 +76,8 @@ echo "Info: Configured opnfv deployment host for openstack-ansible" if [[ $XCI_FLAVOR != "aio" ]]; then echo "Info: Configuring target hosts for openstack-ansible" echo "-----------------------------------------------------------------------" - cd $XCI_PLAYBOOKS - ansible-playbook ${XCI_ANSIBLE_VERBOSITY} -i ${XCI_FLAVOR_ANSIBLE_FILE_PATH}/inventory \ + cd $OSA_XCI_PLAYBOOKS + ansible-playbook ${XCI_ANSIBLE_VERBOSITY} -e XCI_PATH="${XCI_PATH}" -i ${XCI_FLAVOR_ANSIBLE_FILE_PATH}/inventory \ configure-targethosts.yml echo "-----------------------------------------------------------------------" echo "Info: Configured target hosts" diff --git a/xci/playbooks/bootstrap-scenarios.yml b/xci/nfvi/osa/playbooks/bootstrap-scenarios.yml index 50f7b246..98acf73b 100644 --- a/xci/playbooks/bootstrap-scenarios.yml +++ b/xci/nfvi/osa/playbooks/bootstrap-scenarios.yml @@ -7,17 +7,17 @@ # - name: Include foobar role # include_role: # name: "foobar" -# when: OPNFV_SCENARIO == "foobar" +# when: DEPLOY_SCENARIO == "foobar" - name: Prepare everything to run the os-nosdn-nofeature scenario include_role: name: "os-nosdn-nofeature" - when: OPNFV_SCENARIO == 'os-nosdn-nofeature' + when: DEPLOY_SCENARIO == 'os-nosdn-nofeature' - name: Prepare everything to run the os-odl-nofeature scenario include_role: name: "os-odl-nofeature" - when: OPNFV_SCENARIO == 'os-odl-nofeature' + when: DEPLOY_SCENARIO == 'os-odl-nofeature' - name: Prepare everything to run the os-odl-sfc scenario include_role: name: "os-odl-sfc" - when: OPNFV_SCENARIO == 'os-odl-sfc' + when: DEPLOY_SCENARIO == 'os-odl-sfc' diff --git a/xci/playbooks/configure-localhost.yml b/xci/nfvi/osa/playbooks/configure-localhost.yml index 279ae162..caa5d673 100644 --- a/xci/playbooks/configure-localhost.yml +++ b/xci/nfvi/osa/playbooks/configure-localhost.yml @@ -9,13 +9,16 @@ ############################################################################## - hosts: localhost connection: local - vars_files: - - ../var/opnfv.yml pre_tasks: - name: Load distribution variables include_vars: - file: ../var/{{ ansible_os_family }}.yml + file: "{{ item }}" + failed_when: false + with_items: + - "{{ XCI_PATH }}/xci/var/opnfv.yml" + - "{{ XCI_PATH }}/xci/var/{{ ansible_os_family }}.yml" + - name: cleanup leftovers of previous deployment file: path: "{{ item }}" diff --git a/xci/playbooks/configure-opnfvhost.yml b/xci/nfvi/osa/playbooks/configure-opnfvhost.yml index 30831bec..656f18e8 100644 --- a/xci/playbooks/configure-opnfvhost.yml +++ b/xci/nfvi/osa/playbooks/configure-opnfvhost.yml @@ -10,14 +10,15 @@ - hosts: opnfv remote_user: root vars_files: - - ../var/opnfv.yml + - "{{ XCI_PATH }}/xci/var/opnfv.yml" + pre_tasks: - name: Load distribution variables include_vars: file: "{{ item }}" with_items: - - ../var/{{ ansible_os_family }}.yml - - ../file/{{ XCI_FLAVOR }}/flavor-vars.yml + - "{{ XCI_PATH }}/xci/var/{{ ansible_os_family }}.yml" + - "{{ XCI_PATH }}/xci/file/{{ XCI_FLAVOR }}/flavor-vars.yml" - name: Set facts for remote deployment set_fact: remote_xci_path: "{{ ansible_env.HOME }}/releng-xci" @@ -36,7 +37,7 @@ - name: fetch public key fetch: src: "{{ ansible_env.HOME }}/.ssh/id_rsa.pub" - dest: "../file/authorized_keys" + dest: "{{ XCI_PATH }}/xci/file/authorized_keys" flat: yes - name: Copy releng-xci to remote host synchronize: @@ -55,7 +56,7 @@ shell: "/bin/cp -rf {{ remote_xci_flavor_files }}/user_variables.yml {{OPENSTACK_OSA_ETC_PATH}}" failed_when: false - name: copy cinder.yml - shell: "/bin/cp -rf {{ remote_xci_path }}/xci/file/cinder.yml {{OPENSTACK_OSA_ETC_PATH}}/env.d" + shell: "/bin/cp -rf {{ remote_xci_path }}/xci/nfvi/osa/files/cinder.yml {{OPENSTACK_OSA_ETC_PATH}}/env.d" - name: Configure AIO tempest lineinfile: path: "{{ OPENSTACK_OSA_ETC_PATH }}/user_variables.yml" @@ -79,16 +80,16 @@ regexp: '(\s+)haproxy_state: disabled' replace: '\1haproxy_state: enabled' - name: copy OPNFV OpenStack playbook - shell: "/bin/cp -rf {{ remote_xci_path }}/xci/file/setup-openstack.yml {{OPENSTACK_OSA_PATH}}/playbooks" + shell: "/bin/cp -rf {{ remote_xci_path }}/xci/nfvi/osa/files/setup-openstack.yml {{OPENSTACK_OSA_PATH}}/playbooks" - name: copy pinned versions of OSA Roles and global requirements - shell: "/bin/cp -rf {{ remote_xci_path }}/xci/file/{{ item }} {{OPENSTACK_OSA_PATH}}/{{ item }}" + shell: "/bin/cp -rf {{ remote_xci_path }}/xci/nfvi/osa/files/{{ item }} {{OPENSTACK_OSA_PATH}}/{{ item }}" with_items: - "ansible-role-requirements.yml" - "global-requirement-pins.txt" when: - OPENSTACK_OSA_VERSION != "master" - name: copy pinned versions of OpenStack services - shell: "/bin/cp -rf {{ remote_xci_path }}/xci/file/openstack_services.yml {{OPENSTACK_OSA_PATH}}/playbooks/defaults/repo_packages/openstack_services.yml" + shell: "/bin/cp -rf {{ remote_xci_path }}/xci/nfvi/osa/files/openstack_services.yml {{OPENSTACK_OSA_PATH}}/playbooks/defaults/repo_packages/openstack_services.yml" when: - OPENSTACK_OSA_VERSION != "master" - include: bootstrap-scenarios.yml @@ -148,26 +149,25 @@ - hosts: localhost remote_user: root - vars_files: - - ../var/opnfv.yml + tasks: - name: Append public keys to authorized_keys - shell: "/bin/cat {{ ansible_env.HOME }}/.ssh/id_rsa.pub >> ../file/authorized_keys" + shell: "/bin/cat {{ ansible_env.HOME }}/.ssh/id_rsa.pub >> {{ XCI_PATH }}/xci/file/authorized_keys" - hosts: opnfv remote_user: root vars_files: - - ../var/opnfv.yml + - "{{ XCI_PATH }}/xci/var/opnfv.yml" + pre_tasks: - name: Load distribution variables include_vars: file: "{{ item }}" failed_when: false with_items: - - ../var/opnfv.yml - - ../var/{{ ansible_os_family }}.yml - - ../file/{{ XCI_FLAVOR }}/flavor-vars.yml - - ../file/{{ XCI_FLAVOR }}/user_variables.yml + - "{{ XCI_PATH }}/xci/var/{{ ansible_os_family }}.yml" + - "{{ XCI_PATH }}/xci/file/{{ XCI_FLAVOR }}/flavor-vars.yml" + - "{{ XCI_PATH }}/xci/file/{{ XCI_FLAVOR }}/user_variables.yml" roles: - role: "openstack-ansible-openstack_openrc" diff --git a/xci/playbooks/configure-targethosts.yml b/xci/nfvi/osa/playbooks/configure-targethosts.yml index d136f436..14a9149b 100644 --- a/xci/playbooks/configure-targethosts.yml +++ b/xci/nfvi/osa/playbooks/configure-targethosts.yml @@ -4,21 +4,21 @@ tasks: - name: add public key to host copy: - src: ../file/authorized_keys + src: "{{ XCI_PATH }}/xci/file/authorized_keys" dest: /root/.ssh/authorized_keys - hosts: controller remote_user: root vars_files: - - ../var/opnfv.yml + - "{{ XCI_PATH }}/xci/var/opnfv.yml" pre_tasks: - name: Load distribution variables include_vars: file: "{{ item }}" with_items: - - ../var/{{ ansible_os_family }}.yml - - ../file/{{ XCI_FLAVOR }}/flavor-vars.yml + - "{{ XCI_PATH }}/xci/var/{{ ansible_os_family }}.yml" + - "{{ XCI_PATH }}/xci/file/{{ XCI_FLAVOR }}/flavor-vars.yml" roles: - role: configure-network # we need to force sync time with ntp or the nodes will be out of sync timewise @@ -27,16 +27,15 @@ - hosts: compute remote_user: root vars_files: - - ../var/opnfv.yml + - "{{ XCI_PATH }}/xci/var/opnfv.yml" pre_tasks: - name: Load distribution variables include_vars: file: "{{ item }}" with_items: - - ../var/opnfv.yml - - ../var/{{ ansible_os_family }}.yml - - ../file/{{ XCI_FLAVOR }}/flavor-vars.yml + - "{{ XCI_PATH }}/xci/var/{{ ansible_os_family }}.yml" + - "{{ XCI_PATH }}/xci/file/{{ XCI_FLAVOR }}/flavor-vars.yml" roles: - role: configure-network # we need to force sync time with ntp or the nodes will be out of sync timewise diff --git a/xci/playbooks/inventory b/xci/nfvi/osa/playbooks/inventory index fd9af901..fd9af901 100644 --- a/xci/playbooks/inventory +++ b/xci/nfvi/osa/playbooks/inventory diff --git a/xci/nfvi/osa/playbooks/xci-deploy.sh b/xci/nfvi/osa/playbooks/xci-deploy.sh new file mode 100755 index 00000000..89fb455b --- /dev/null +++ b/xci/nfvi/osa/playbooks/xci-deploy.sh @@ -0,0 +1,183 @@ +#!/bin/bash +set -o errexit +set -o nounset +set -o pipefail + +submit_bug_report() { + cd ${XCI_PATH} + echo "" + echo "-------------------------------------------------------------------------" + echo "Oh nooooo! The XCI deployment failed miserably :-(" + echo "" + echo "If you need help, please choose one of the following options" + echo "* #opnfv-pharos @ freenode network" + echo "* opnfv-tech-discuss mailing list (https://lists.opnfv.org/mailman/listinfo/opnfv-tech-discuss)" + echo " - Please prefix the subject with [XCI]" + echo "* https://jira.opnfv.org (Release Engineering project)" + echo "" + echo "Do not forget to submit the following information on your bug report:" + echo "" + git diff --quiet && echo "releng-xci tree status: clean" || echo "releng-xci tree status: local modifications" + echo "opnfv/releng-xci version: $(git rev-parse HEAD)" + echo "openstack/bifrost version: $OPENSTACK_BIFROST_VERSION" + echo "openstack/openstack-ansible version: $OPENSTACK_OSA_VERSION" + echo "xci flavor: $XCI_FLAVOR" + echo "xci nfvi: $XCI_NFVI" + echo "Environment variables:" + env | grep --color=never '\(OPNFV\|XCI\|OPENSTACK\)' + echo "-------------------------------------------------------------------------" +} + +#------------------------------------------------------------------------------- +# This script should not be run as root +#------------------------------------------------------------------------------- +if [[ $(whoami) == "root" ]]; then + echo "WARNING: This script should not be run as root!" + echo "Elevated privileges are aquired automatically when necessary" + echo "Waiting 10s to give you a chance to stop the script (Ctrl-C)" + for x in $(seq 10 -1 1); do echo -n "$x..."; sleep 1; done +fi + +#------------------------------------------------------------------------------- +# Set environment variables +#------------------------------------------------------------------------------- +# The order of sourcing the variable files is significant so please do not +# change it or things might stop working. +# - user-vars: variables that can be configured or overriden by user. +# - pinned-versions: versions to checkout. These can be overriden if you want to +# use different/more recent versions of the tools but you might end up using +# something that is not verified by OPNFV XCI. +# - flavor-vars: settings for VM nodes for the chosen flavor. +# - env-vars: variables for the xci itself and you should not need to change or +# override any of them. +#------------------------------------------------------------------------------- +# find where are we +export XCI_PATH="$(git rev-parse --show-toplevel)" +# source user vars +source $XCI_PATH/xci/config/user-vars +# source pinned versions +source $XCI_PATH/xci/config/pinned-versions +# source flavor configuration +source "$XCI_PATH/xci/config/${XCI_FLAVOR}-vars" +# source NFVI configuration +source "$XCI_PATH/xci/nfvi/${XCI_NFVI}/env" &>/dev/null || true +# source xci configuration +source $XCI_PATH/xci/config/env-vars + +if [[ -z $(echo $PATH | grep "$HOME/.local/bin") ]]; then + export PATH="$HOME/.local/bin:$PATH" +fi + +#------------------------------------------------------------------------------- +# Sanitize local development environment variables +#------------------------------------------------------------------------------- +user_local_dev_vars=(OPENSTACK_OSA_DEV_PATH OPENSTACK_BIFROST_DEV_PATH) +for local_user_var in ${user_local_dev_vars[@]}; do + [[ -n ${!local_user_var:-} ]] && export $local_user_var=${!local_user_var%/}/ +done +unset user_local_dev_vars local_user_var + +# register our handler +trap submit_bug_report ERR + +#------------------------------------------------------------------------------- +# Log info to console +#------------------------------------------------------------------------------- +echo "Info: Starting XCI Deployment" +echo "Info: Deployment parameters" +echo "-------------------------------------------------------------------------" +echo "xci flavor: $XCI_FLAVOR" +echo "xci nfvi: $XCI_NFVI" +echo "opnfv/releng-xci version: $(git rev-parse HEAD)" +echo "openstack/bifrost version: $OPENSTACK_BIFROST_VERSION" +echo "openstack/openstack-ansible version: $OPENSTACK_OSA_VERSION" +echo "OPNFV scenario: $DEPLOY_SCENARIO" +echo "-------------------------------------------------------------------------" + +#------------------------------------------------------------------------------- +# Install ansible on localhost +#------------------------------------------------------------------------------- +echo "Info: Installing Ansible from pip" +echo "-------------------------------------------------------------------------" +source file/install-ansible.sh +echo "-------------------------------------------------------------------------" + +# Make the VMs match the host. If we need to make this configurable +# then this logic has to be moved outside this file +case ${OS_FAMILY,,} in + # These should ideally match the CI jobs + debian) + export DIB_OS_RELEASE="${DIB_OS_RELEASE:-xenial}" + export DIB_OS_ELEMENT="${DIB_OS_ELEMENT:-ubuntu-minimal}" + export DIB_OS_PACKAGES="${DIB_OS_PACKAGES:-vlan,vim,less,bridge-utils,language-pack-en,iputils-ping,rsyslog,curl,iptables}" + ;; + redhat) + export DIB_OS_RELEASE="${DIB_OS_RELEASE:-7}" + export DIB_OS_ELEMENT="${DIB_OS_ELEMENT:-centos-minimal}" + export DIB_OS_PACKAGES="${DIB_OS_PACKAGES:-vim,less,bridge-utils,iputils,rsyslog,curl,iptables}" + ;; + suse) + export DIB_OS_RELEASE="${DIB_OS_RELEASE:-42.3}" + export DIB_OS_ELEMENT="${DIB_OS_ELEMENT:-opensuse-minimal}" + export DIB_OS_PACKAGES="${DIB_OS_PACKAGES:-vim,less,bridge-utils,iputils,rsyslog,curl,iptables}" + ;; +esac + +# There is no CentOS support at all +if [[ $OS_FAMILY == RedHat ]]; then + echo "" + echo "Error: Sorry, only Ubuntu and SUSE hosts are supported for now!" + echo "Error: CentOS 7 support is still work in progress." + echo "" + exit 1 +fi + +# Clone OPNFV scenario repositories +#------------------------------------------------------------------------------- +# This playbook +# - removes existing scenario roles +# - clones OPNFV scenario roles based on the file/opnfv-scenario-requirements.yml file +#------------------------------------------------------------------------------- +echo "Info: Cloning OPNFV scenario repositories" +echo "-------------------------------------------------------------------------" +cd $XCI_PATH/xci/playbooks +ansible-playbook ${XCI_ANSIBLE_VERBOSITY} -i inventory get-opnfv-scenario-requirements.yml +echo "-------------------------------------------------------------------------" + +#------------------------------------------------------------------------------- +# Get scenario variables overrides +#------------------------------------------------------------------------------- +if [[ -f $XCI_SCENARIOS_CACHE/${DEPLOY_SCENARIO:-_no_scenario_}/xci_overrides ]]; then + source $XCI_SCENARIOS_CACHE/$DEPLOY_SCENARIO/xci_overrides +fi + +#------------------------------------------------------------------------------- +# Start provisioning VM nodes +#------------------------------------------------------------------------------- +# This playbook +# - removes directories that were created by the previous xci run +# - clones opnfv/releng-xci and openstack/bifrost repositories +# - combines opnfv/releng-xci and openstack/bifrost scripts/playbooks +# - destroys VMs, removes ironic db, leases, logs +# - creates and provisions VMs for the chosen flavor +#------------------------------------------------------------------------------- +echo "Info: Starting provisining VM nodes using openstack/bifrost" +echo "-------------------------------------------------------------------------" +# We are using sudo so we need to make sure that env_reset is not present +sudo sed -i "s/^Defaults.*env_reset/#&/" /etc/sudoers +cd $XCI_PATH/bifrost/ +sudo -E bash ./scripts/destroy-env.sh +cd $XCI_PLAYBOOKS +ansible-playbook ${XCI_ANSIBLE_VERBOSITY} -i inventory provision-vm-nodes.yml +cd ${XCI_CACHE}/repos/bifrost +bash ./scripts/bifrost-provision.sh +echo "-----------------------------------------------------------------------" +echo "Info: VM nodes are provisioned!" +echo "-----------------------------------------------------------------------" + +# Deploy OpenStack on the selected NFVI +echo "Info: Deploying '${XCI_NFVI}' NFVI" +echo "-----------------------------------------------------------------------" +source ${XCI_PATH}/xci/nfvi/${XCI_NFVI}/nfvi-deploy.sh + +# vim: set ts=4 sw=4 expandtab: diff --git a/xci/playbooks/get-opnfv-scenario-requirements.yml b/xci/playbooks/get-opnfv-scenario-requirements.yml index 173b825e..7f10a465 100644 --- a/xci/playbooks/get-opnfv-scenario-requirements.yml +++ b/xci/playbooks/get-opnfv-scenario-requirements.yml @@ -23,7 +23,7 @@ tasks: - name: Remove existing scenario directories file: - path: "{{ item[1] }} + '/' + {{ item[0].scenario }}" + path: "{{ item[1] }}/{{ item[0].scenario }}" state: absent with_nested: - "{{ scenarios }}" @@ -33,7 +33,7 @@ - name: Create scenario directories file: - path: "{{ role_path_default }} + '/' + item.scenario }}" + path: "{{ role_path_default }}/{{ item.scenario }}" state: directory with_items: "{{ scenarios }}" loop_control: @@ -83,19 +83,19 @@ loop_control: label: "{{ item.item.scenario }}" - - name: Determine if selected {{ OPNFV_SCENARIO }} scenario can be deployed + - name: Determine if selected {{ DEPLOY_SCENARIO }} scenario can be deployed set_fact: - deploy_scenario_on_flavor: XCI_FLAVOR in item.flavors - when: OPNFV_SCENARIO == item.scenario + deploy_scenario_on_flavor: "{{ (XCI_FLAVOR in item.flavors) | ternary(True, False) }}" + when: DEPLOY_SCENARIO == item.scenario with_items: "{{ scenarios }}" loop_control: label: "{{ item.scenario }}" - - name: Fail if {{ XCI_FLAVOR }} is not supported in {{ OPNFV_SCENARIO }} + - name: Fail if {{ XCI_FLAVOR }} is not supported in {{ DEPLOY_SCENARIO }} fail: msg: - ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - - ERROR! The {{ OPNFV_SCENARIO }} scenario does not support the {{ XCI_FLAVOR }} + - ERROR! The {{ DEPLOY_SCENARIO }} scenario does not support the {{ XCI_FLAVOR }} - '' - This is a great chance for you to contribute to XCI ;-) - ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/xci/scenarios/os-odl-nofeature/xci_overrides b/xci/scenarios/os-odl-nofeature/xci_overrides index ed6c4489..2c65df0d 100644 --- a/xci/scenarios/os-odl-nofeature/xci_overrides +++ b/xci/scenarios/os-odl-nofeature/xci_overrides @@ -1,7 +1,7 @@ #!/bin/bash -if [[ $OPNFV_SCENARIO == "os-odl-nofeature" ]] && [[ $XCI_FLAVOR == "ha" ]]; then +if [[ $DEPLOY_SCENARIO == "os-odl-nofeature" ]] && [[ $XCI_FLAVOR == "ha" ]]; then export VM_MEMORY_SIZE=20480 -elif [[ $OPNFV_SCENARIO == "os-odl-nofeature" ]]; then +elif [[ $DEPLOY_SCENARIO == "os-odl-nofeature" ]]; then export VM_MEMORY_SIZE=16384 -fi
\ No newline at end of file +fi diff --git a/xci/scripts/update-osa-version-files.sh b/xci/scripts/update-osa-version-files.sh index 52e21ca5..678ad03f 100755 --- a/xci/scripts/update-osa-version-files.sh +++ b/xci/scripts/update-osa-version-files.sh @@ -66,8 +66,8 @@ echo """--- # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## # these versions are based on the osa commit ${1} on $(git --no-pager log -1 --format=%cd --date=format:%Y-%m-%d $1) -# https://review.openstack.org/gitweb?p=openstack/openstack-ansible.git;a=commit;h=$1""" > $releng_xci_base/file/ansible-role-requirements.yml -cat $tempdir/openstack-ansible/ansible-role-requirements.yml >> $releng_xci_base/file/ansible-role-requirements.yml +# https://review.openstack.org/gitweb?p=openstack/openstack-ansible.git;a=commit;h=$1""" > $releng_xci_base/nfvi/osa/files/ansible-role-requirements.yml +cat $tempdir/openstack-ansible/ansible-role-requirements.yml >> $releng_xci_base/nfvi/osa/files/ansible-role-requirements.yml # Update the pinned OSA version sed -i -e "/^export OPENSTACK_OSA_VERSION/s@:-\"[a-z0-9]*@:-\"${1}@" \ @@ -78,8 +78,8 @@ sed -i -e "/^export OPENSTACK_OSA_VERSION/s@:-\"[a-z0-9]*@:-\"${1}@" \ sed -i -e "/^export OPENSTACK_BIFROST_VERSION/s@:-\"[a-z0-9]*@:-\"${2}@" \ -e "s/\(^# HEAD of bifrost.*of \).*/\1$(date +%d\.%m\.%Y)/" $releng_xci_base/config/pinned-versions -cp $tempdir/openstack-ansible/playbooks/defaults/repo_packages/openstack_services.yml ${releng_xci_base}/file/. -cp $tempdir/openstack-ansible/global-requirement-pins.txt ${releng_xci_base}/file/. +cp $tempdir/openstack-ansible/playbooks/defaults/repo_packages/openstack_services.yml ${releng_xci_base}/nfvi/osa/files/. +cp $tempdir/openstack-ansible/global-requirement-pins.txt ${releng_xci_base}/nfvi/osa/files/. popd &> /dev/null @@ -87,9 +87,9 @@ printme "" printme "======================= Report ============================" printme "" printme "The following files have been updated:" -printme "- $releng_xci_base/file/ansible-role-requirements.yml" -printme "- $releng_xci_base/file/global-requirement-pins.txt" -printme "- $releng_xci_base/file/openstack_services.yml" +printme "- $releng_xci_base/nfvi/osa/files/ansible-role-requirements.yml" +printme "- $releng_xci_base/nfvi/osa/files/global-requirement-pins.txt" +printme "- $releng_xci_base/nfvi/osa/files/openstack_services.yml" printme "- $releng_xci_base/config/pinned-versions" printme "Please make sure you test the end result before committing it!" printme "" diff --git a/xci/var/opnfv.yml b/xci/var/opnfv.yml index 19a5cca1..6d288338 100644 --- a/xci/var/opnfv.yml +++ b/xci/var/opnfv.yml @@ -32,7 +32,7 @@ XCI_EXTRA_VARS_PATH: "{{ lookup('env', 'XCI_EXTRA_VARS_PATH') }}" XCI_SSL_SUBJECT: "{{ lookup('env', 'XCI_SSL_SUBJECT') }}" XCI_CEPH_ENABLED: "{{ lookup('env', 'XCI_CEPH_ENABLED') }}" RUN_TEMPEST: "{{ lookup('env', 'RUN_TEMPEST') }}" -OPNFV_SCENARIO: "{{ lookup('env','OPNFV_SCENARIO') }}" +DEPLOY_SCENARIO: "{{ lookup('env','DEPLOY_SCENARIO') }}" # install docker on opnfv host only if we are running as part of CI opnfv_required_packages: diff --git a/xci/xci-deploy.sh b/xci/xci-deploy.sh index 3f28e48f..89fb455b 100755 --- a/xci/xci-deploy.sh +++ b/xci/xci-deploy.sh @@ -91,7 +91,7 @@ echo "xci nfvi: $XCI_NFVI" echo "opnfv/releng-xci version: $(git rev-parse HEAD)" echo "openstack/bifrost version: $OPENSTACK_BIFROST_VERSION" echo "openstack/openstack-ansible version: $OPENSTACK_OSA_VERSION" -echo "OPNFV scenario: $OPNFV_SCENARIO" +echo "OPNFV scenario: $DEPLOY_SCENARIO" echo "-------------------------------------------------------------------------" #------------------------------------------------------------------------------- @@ -147,8 +147,8 @@ echo "-------------------------------------------------------------------------" #------------------------------------------------------------------------------- # Get scenario variables overrides #------------------------------------------------------------------------------- -if [[ -f $XCI_SCENARIOS_CACHE/${OPNFV_SCENARIO:-_no_scenario_}/xci_overrides ]]; then - source $XCI_SCENARIOS_CACHE/$OPNFV_SCENARIO/xci_overrides +if [[ -f $XCI_SCENARIOS_CACHE/${DEPLOY_SCENARIO:-_no_scenario_}/xci_overrides ]]; then + source $XCI_SCENARIOS_CACHE/$DEPLOY_SCENARIO/xci_overrides fi #------------------------------------------------------------------------------- |