become: yes
- name: Download the {{ xci_distro }} image checksum file
get_url:
- dest: /httpboot/{{ xci_distro }}.qcow2.sha256.txt
+ dest: /httpboot/deployment_image.qcow2.sha256.txt
force: no
url: http://artifacts.opnfv.org/releng/xci/images/{{ xci_distro }}.qcow2.sha256.txt
timeout: 3000
become: yes
- name: Extract checksum
- shell: awk '{print $1}' /httpboot/{{ xci_distro }}.qcow2.sha256.txt
+ shell: awk '{print $1}' /httpboot/deployment_image.qcow2.sha256.txt
register: _image_checksum
- fail:
msg: "Failed to get image checksum"
# Additional dib elements
export EXTRA_DIB_ELEMENTS=${EXTRA_DIB_ELEMENTS:-"openssh-server"}
+# Copy the OS images if found
+if [[ -e ${XCI_PATH}/deployment_image.qcow2 ]]; then
+ sudo mkdir -p /httpboot
+ sudo mv ${XCI_PATH}/deployment_image.qcow2* /httpboot/
+fi
+
if [ ${USE_VENV} = "true" ]; then
export VENV=/opt/stack/bifrost
$SCRIPT_HOME/env-setup.sh &>/dev/null
sudo chmod 777 -R $XCI_CACHE_DIR/clean_vm/images/
sudo chown $uid:$gid -R $XCI_CACHE_DIR/clean_vm/images/
cp ${XCI_CACHE_DIR}/clean_vm/images/${OS}.qcow2* ${BASE_PATH}/
+cp ${XCI_CACHE_DIR}/clean_vm/images/${OS}.qcow2.sha256.txt ${BASE_PATH}/deployment_image.qcow2.sha256.txt
+cp ${XCI_CACHE_DIR}/clean_vm/images/${OS}.qcow2 ${BASE_PATH}/deployment_image.qcow2
declare -r OS_IMAGE_FILE=${OS}.qcow2
[[ ! -e ${OS_IMAGE_FILE} ]] && echo "${OS_IMAGE_FILE} not found! This should never happen!" && exit 1
do_copy() {
rsync -a \
--exclude "${VM_NAME}*" \
+ --exclude "${OS}*" \
--exclude "build.log" \
-e "$vm_ssh" ${BASE_PATH}/ ${VM_NAME}:~/releng-xci/
}
# Disable 3-level nested virtualization since it makes things terribly slow
$vm_ssh ${VM_NAME} "sudo bash -c 'echo \"options kvm_intel nested=0\" > /etc/modprobe.d/qemu-system-x86.conf'"
$vm_ssh ${VM_NAME} "sudo modprobe -r kvm_intel && sudo modprobe -a kvm_intel"
-# Copy image files over
-$vm_ssh ${VM_NAME} "sudo mkdir /httpboot"
-$vm_ssh ${VM_NAME} "sudo mv /home/devuser/releng-xci/${OS}.qcow2.sha256.txt /httpboot"
-$vm_ssh ${VM_NAME} "sudo mv /home/devuser/releng-xci/${OS}.qcow2 /httpboot/deployment_image.qcow2"
set +e