Merge "Rework jobs so failed devstack does not retry the job"

This commit is contained in:
Zuul 2020-09-18 11:55:04 +00:00 committed by Gerrit Code Review
commit 88a6a5b28b
4 changed files with 131 additions and 119 deletions

View File

@ -3,7 +3,6 @@
description: |
Base job for devstack-based metalsmith jobs.
parent: devstack-minimal
pre-run: playbooks/integration/pre.yaml
post-run: playbooks/integration/post.yaml
run: playbooks/integration/run.yaml
irrelevant-files:
@ -120,7 +119,6 @@
Integration job using Glance as image source and CentOS7 with local boot.
parent: metalsmith-integration-base
timeout: 7200
pre-run: playbooks/integration/centos-image.yaml
vars:
devstack_localrc:
# NOTE(dtantsur): we need to use streaming, otherwise the image won't

View File

@ -1,16 +1,12 @@
---
- hosts: all
environment:
OS_CLOUD: devstack-admin
vars:
- name: Set facts for centos image builds
set_fact:
centos_image_file: ~/centos-download.qcow2
centos_initramfs_file: ~/centos.initramfs
centos_kernel_file: ~/centos.kernel
centos_partition_file: ~/centos-root.qcow2
centos_image_url: https://cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud.qcow2.xz
tasks:
- name: Install guestfish
package:
name: libguestfs-tools
@ -41,6 +37,8 @@
openstack image create --disk-format qcow2
--public --file {{ centos_image_file }}
{{ centos_glance_whole_disk_image }}
environment:
OS_CLOUD: devstack-admin
when: centos_glance_whole_disk_image is defined
- name: Create a temporary directory for extraction
@ -61,6 +59,8 @@
{{ centos_glance_kernel_image }}
register: centos_kernel_id
failed_when: centos_kernel_id.stdout == ""
environment:
OS_CLOUD: devstack-admin
when: centos_glance_kernel_image is defined
- name: Upload the CentOS initramfs image
@ -70,6 +70,8 @@
{{ centos_glance_initramds_image }}
register: centos_initramfs_id
failed_when: centos_initramfs_id.stdout == ""
environment:
OS_CLOUD: devstack-admin
when: centos_glance_initramds_image is defined
- name: Delete the kernel and ramdisk image files
@ -137,6 +139,8 @@
--property kernel_id={{ centos_kernel_id.stdout }}
--property ramdisk_id={{ centos_initramfs_id.stdout }}
{{ centos_glance_root_image }}
environment:
OS_CLOUD: devstack-admin
when: centos_glance_root_image is defined
- name: Remove the partition image file

View File

@ -1,4 +1,7 @@
---
- name: Perform initial setup
include: initial-setup.yaml
- hosts: all
environment:
OS_CLOUD: devstack-admin
@ -6,8 +9,15 @@
tasks:
- include_tasks: ssh-key.yaml
- include_tasks: centos-image.yaml
when:
- metalsmith_whole_disk_image is defined
- metalsmith_partition_image is defined
- include_tasks: cirros-image.yaml
when: metalsmith_whole_disk_image is not defined
when:
- metalsmith_whole_disk_image is undefined
- metalsmith_partition_image is undefined
- name: Test a whole-disk image
include_tasks: exercise.yaml