Create the log file for the disk-image-create command

Change-Id: Iab88b3a28378cc22f767204bef84128bc9627210
Signed-off-by: Maksim Malchuk <maksim.malchuk@gmail.com>
This commit is contained in:
Maksim Malchuk 2021-12-02 21:30:21 +03:00
parent ec182e7293
commit e3fb8c54d0
3 changed files with 9 additions and 2 deletions

View File

@ -17,6 +17,7 @@ dib_notmpfs: false
dib_offline: false
dib_skipbase: false
dib_packages: ""
disk_image_create_log: /tmp/disk-image-create.log
ipa_git_folder: /opt/stack/ironic-python-agent
reqs_git_folder: /opt/stack/requirements
ipa_builder_git_folder: /opt/stack/ironic-python-agent-builder

View File

@ -154,7 +154,7 @@
when: partition_info is defined and 'content' in partition_info
- name: "Build argument list"
set_fact:
dib_arglist: >
dib_arglist: >-
{{ dib_trace_arg | default('') }}
{{ dib_uncompressed_arg | default('') }}
{{ dib_clearenv_arg | default('') }}
@ -177,7 +177,11 @@
{{ dib_os_element }}
{{ dib_elements | default('') }}
- name: "Initiate image build"
command: disk-image-create {{ dib_arglist }}
shell: |
set -o pipefail
disk-image-create {{ dib_arglist }} 2>&1 | tee {{ disk_image_create_log }}
args:
executable: /bin/bash
environment: "{{ dib_env_vars_final | combine(bifrost_venv_env) }}"
when:
- not build_ramdisk | bool

View File

@ -71,6 +71,8 @@ mkdir -p ${LOG_LOCATION}/all
sudo cp -aL /var/log/* ${LOG_LOCATION}/all/.
sudo chown -R $USER ${LOG_LOCATION}/all
[ -f /tmp/disk-image-create.log ] && sudo cp -a /tmp/disk-image-create.log ${LOG_LOCATION}
sudo systemctl > ${LOG_LOCATION}/all-services.txt
sudo journalctl -u libvirtd &> ${LOG_LOCATION}/libvirtd.log
sudo journalctl -u ironic &> ${LOG_LOCATION}/ironic.log