we maybe introduce other NFVI in the future in XCI.
it is necessary to put the nfvi files to corresponding directory xci/nfvi/$NFVI/files,
otherwise the files directory will be confused.
Change-Id: Iea98167ff0bc8d338a94fe1c064ac0ab396c53d3
Signed-off-by: wutianwei <wutianwei1@huawei.com>
export OPENSTACK_OSA_OPENRC_GIT_URL=https://git.openstack.org/openstack/openstack-ansible-openstack_openrc
export OPENSTACK_OSA_ETC_PATH=/etc/openstack_deploy
export OPNFV_HOST_IP=192.168.122.2
-export XCI_FLAVOR_ANSIBLE_FILE_PATH=$XCI_PATH/xci/file/$XCI_FLAVOR
+export XCI_FLAVOR_ANSIBLE_FILE_PATH=$XCI_PATH/xci/nfvi/$XCI_NFVI/files/$XCI_FLAVOR
export CI_LOOP=${CI_LOOP:-daily}
export JOB_NAME=${JOB_NAME:-false}
# XCI_CACHE is a cache on localhost where repositories and scenarios are cloned.
#-------------------------------------------------------------------------------
echo "Info: Openstack login details"
echo "-----------------------------------------------------------------------"
-OS_USER_CONFIG=$XCI_PATH/xci/file/$XCI_FLAVOR/openstack_user_config.yml
+OS_USER_CONFIG=$XCI_FLAVOR_ANSIBLE_FILE_PATH/openstack_user_config.yml
python -c \
"import yaml
if '$XCI_FLAVOR' is 'aio':
file: "{{ item }}"
with_items:
- "{{ XCI_PATH }}/xci/var/{{ ansible_os_family }}.yml"
- - "{{ XCI_PATH }}/xci/file/{{ XCI_FLAVOR }}/flavor-vars.yml"
+ - "{{ XCI_FLAVOR_ANSIBLE_FILE_PATH }}/flavor-vars.yml"
- name: Set facts for remote deployment
set_fact:
remote_xci_path: "{{ ansible_env.HOME }}/releng-xci"
- remote_xci_flavor_files: "{{ ansible_env.HOME }}/releng-xci/xci/file/{{ XCI_FLAVOR }}"
+ remote_xci_flavor_files: "{{ ansible_env.HOME }}/releng-xci/xci/nfvi/{{XCI_NFVI}}/files/{{ XCI_FLAVOR }}"
remote_xci_playbooks: "{{ ansible_env.HOME }}/releng-xci/xci/playbooks"
roles:
- name: fetch public key
fetch:
src: "{{ ansible_env.HOME }}/.ssh/id_rsa.pub"
- dest: "{{ XCI_PATH }}/xci/file/authorized_keys"
+ dest: "{{ XCI_PATH }}/xci/files/authorized_keys"
flat: yes
- name: Copy releng-xci to remote host
synchronize:
tasks:
- name: Append public keys to authorized_keys
- shell: "/bin/cat {{ ansible_env.HOME }}/.ssh/id_rsa.pub >> {{ XCI_PATH }}/xci/file/authorized_keys"
+ shell: "/bin/cat {{ ansible_env.HOME }}/.ssh/id_rsa.pub >> {{ XCI_PATH }}/xci/files/authorized_keys"
- hosts: opnfv
remote_user: root
failed_when: false
with_items:
- "{{ 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"
+ - "{{ XCI_FLAVOR_ANSIBLE_FILE_PATH }}/flavor-vars.yml"
+ - "{{ XCI_FLAVOR_ANSIBLE_FILE_PATH }}/user_variables.yml"
roles:
- role: "openstack-ansible-openstack_openrc"
tasks:
- name: add public key to host
copy:
- src: "{{ XCI_PATH }}/xci/file/authorized_keys"
+ src: "{{ XCI_PATH }}/xci/files/authorized_keys"
dest: /root/.ssh/authorized_keys
- hosts: controller
file: "{{ item }}"
with_items:
- "{{ XCI_PATH }}/xci/var/{{ ansible_os_family }}.yml"
- - "{{ XCI_PATH }}/xci/file/{{ XCI_FLAVOR }}/flavor-vars.yml"
+ - "{{ XCI_FLAVOR_ANSIBLE_FILE_PATH }}/flavor-vars.yml"
roles:
- role: configure-network
# we need to force sync time with ntp or the nodes will be out of sync timewise
file: "{{ item }}"
with_items:
- "{{ XCI_PATH }}/xci/var/{{ ansible_os_family }}.yml"
- - "{{ XCI_PATH }}/xci/file/{{ XCI_FLAVOR }}/flavor-vars.yml"
+ - "{{ XCI_FLAVOR_ANSIBLE_FILE_PATH }}/flavor-vars.yml"
roles:
- role: configure-network
# we need to force sync time with ntp or the nodes will be out of sync timewise
XCI_CEPH_ENABLED: "{{ lookup('env', 'XCI_CEPH_ENABLED') }}"
RUN_TEMPEST: "{{ lookup('env', 'RUN_TEMPEST') }}"
DEPLOY_SCENARIO: "{{ lookup('env','DEPLOY_SCENARIO') }}"
+XCI_NFVI: "{{ lookup('env','XCI_NFVI') }}"
# install docker on opnfv host only if we are running as part of CI
opnfv_required_packages:
#-------------------------------------------------------------------------------
echo "Info: Installing Ansible from pip"
echo "-------------------------------------------------------------------------"
-source file/install-ansible.sh
+source files/install-ansible.sh
echo "-------------------------------------------------------------------------"
# Make the VMs match the host. If we need to make this configurable
#-------------------------------------------------------------------------------
# This playbook
# - removes existing scenario roles
-# - clones OPNFV scenario roles based on the file/opnfv-scenario-requirements.yml file
+# - clones OPNFV scenario roles based on the xci/opnfv-scenario-requirements.yml file
#-------------------------------------------------------------------------------
echo "Info: Cloning OPNFV scenario repositories"
echo "-------------------------------------------------------------------------"