Skip to content

Commit

Permalink
Small fixes to image sanity check
Browse files Browse the repository at this point in the history
Run Image sanity check only when overcloud build images exists
otherwise ignore it.

It also fixes the hardcoded workspace path in image sanity check
playbook to image build workspace.

Also collects the virt_customize.log in ansible user dir.

Change-Id: I7963bb7c2831cfb1c1d6e9d4a19c0eae66cd8311
Closes-Bug: #1881090
Signed-off-by: Bhagyashri Shewale <bshewale@redhat.com>
  • Loading branch information
bshewale committed May 29, 2020
1 parent a3a09a9 commit 754fa93
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
9 changes: 5 additions & 4 deletions roles/oooci-build-images/tasks/image_sanity.yaml
Expand Up @@ -21,10 +21,11 @@

- 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 }}' > virt_customize.log
virt-copy-out -a overcloud-full.qcow2 {{ image_sanity_files | join(' ') }} {{ ansible_user_dir }}/workspace
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: "{{ ansible_user_dir }}/workspace"
chdir: "{{ workspace }}"
environment:
LIBGUESTFS_BACKEND_SETTINGS: force_tcg
LIBGUESTFS_BACKEND: direct
Expand All @@ -34,7 +35,7 @@
shell: |
grep {{ item }} rpm_va.txt
args:
chdir: "{{ ansible_user_dir }}/workspace"
chdir: "{{ workspace }}"
register: files_missing
changed_when: false
ignore_errors: True
Expand Down
1 change: 1 addition & 0 deletions roles/oooci-build-images/tasks/main.yaml
Expand Up @@ -111,3 +111,4 @@
when:
- tripleo_image_type is search("overcloud-full")
- image_sanity | bool
- overcloud_stat_result.stat.exists|bool

0 comments on commit 754fa93

Please sign in to comment.