43 lines
1.2 KiB
YAML
43 lines
1.2 KiB
YAML
---
|
|
- name: Install guestfs
|
|
include_tasks: guestfs.yaml
|
|
|
|
- name: Run sanity command on overcloud images
|
|
shell: |
|
|
virt-customize -vx --smp 2 -m 2048 -a overcloud-full.qcow2 --selinux-relabel \
|
|
--run-command '{{ image_sanity_command }}' > {{ ansible_user_dir }}/virt_customize.log
|
|
virt-copy-out -a overcloud-full.qcow2 {{ image_sanity_files | join(' ') }} {{ workspace }}
|
|
args:
|
|
chdir: "{{ workspace }}"
|
|
environment:
|
|
LIBGUESTFS_BACKEND_SETTINGS: force_tcg
|
|
LIBGUESTFS_BACKEND: direct
|
|
changed_when: true
|
|
|
|
- name: Look for missing directories
|
|
shell: |
|
|
! grep {{ item }} rpm_va.txt
|
|
args:
|
|
chdir: "{{ workspace }}"
|
|
register: files_missing
|
|
changed_when: false
|
|
ignore_errors: true
|
|
loop: "{{ missing_dirs }}"
|
|
|
|
- name: Show warning if missing files
|
|
debug:
|
|
msg: "WARNING: File(s) are missing on the overcloud image."
|
|
when: "item['rc'] == 1"
|
|
loop: "{{ files_missing.results }}"
|
|
|
|
- name: Fail if missing files (periodic only)
|
|
block:
|
|
- name: Ensure no missing files
|
|
assert:
|
|
that:
|
|
- "item['rc'] == 0"
|
|
loop: "{{ files_missing.results }}"
|
|
when: >
|
|
('periodic' in zuul.pipeline and not force_non_periodic|default(false)|bool) or
|
|
force_periodic|default(false)|bool
|