60 lines
1.6 KiB
YAML
60 lines
1.6 KiB
YAML
---
|
|
- name: Install libguestfs packages
|
|
package:
|
|
name:
|
|
- libvirt
|
|
- libvirt-daemon
|
|
- qemu-kvm-common
|
|
- qemu-kvm
|
|
- libvirt-daemon-kvm
|
|
- libvirt-daemon-driver-network
|
|
- libvirt-daemon-driver-qemu
|
|
- libguestfs-tools
|
|
- libguestfs-tools-c
|
|
state: present
|
|
|
|
- name: Start libvirtd service
|
|
service:
|
|
name: libvirtd
|
|
state: started
|
|
enabled: true
|
|
|
|
- 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
|