DNM, debug for container-modify

Change-Id: Ie3132176b2cebc4c1f173b2cdd3e736d503bba5e
This commit is contained in:
Wesley Hayutin 2021-05-19 11:39:11 -06:00
parent b304c8979c
commit 985daeaf97
2 changed files with 25 additions and 6 deletions

View File

@ -6,9 +6,10 @@
- import_tasks: get_original_user.yml
- name: Create image build context directory
tempfile:
file:
state: directory
prefix: tripleo-modify-image
path: /home/zuul/tripleo-modify-image
mode: 0755
register: context_dir
- name: Set modify_dir_path

View File

@ -106,7 +106,7 @@
- name: Run yum_update.sh
command: >
buildah run
--volume {{ yum_update.path }}:/tmp/yum_update.sh
--volume {{ yum_update.path }}:/tmp
--volume {{ yum_repos_dir_path }}:/etc/yum.repos.d
{% if pkg_mgr_vars_stat.stat.exists %}
--volume /etc/{{ pkg_mgr_suffix }}/vars:/etc/{{ pkg_mgr_suffix }}/vars
@ -123,14 +123,14 @@
--user root
--net host
{{ from_image }}
/tmp/yum_update.sh "{{ update_repo }}"
/tmp/yum_update.sh "{{ update_repo }}" &> /tmp/yum_update.log
register: result
rescue:
- name: Run yum_update.sh (retry without yum cache)
command: >
buildah --debug run
--volume {{ yum_update.path }}:/tmp/yum_update.sh
--volume {{ yum_update.path }}:/tmp
--volume {{ yum_repos_dir_path }}:/etc/yum.repos.d
{% if pkg_mgr_vars_stat.stat.exists %}
--volume /etc/{{ pkg_mgr_suffix }}/vars:/etc/{{ pkg_mgr_suffix }}/vars
@ -144,12 +144,30 @@
--user root
--net host
{{ from_image }}
bash -x /tmp/yum_update.sh "{{ update_repo }}"
bash -x /tmp/yum_update.sh "{{ update_repo }}" &> /tmp/yum_update.log
retries: 2
delay: 3
register: result
until: result.rc == 0
- name: deliniate log with container name
become: true
command: >
/usr/bin/touch /var/log/container_yum_update.log
'/usr/bin/echo "** {{ source_image }} **" >> /var/log/container_yum_update.log'
/usr/bin/cat /tmp/yum_update.log >> /var/log/container_yum_update.log
#- name: log container yum transaction
# command: >
# buildah --debug run
# --user root
# --net host
# {{ from_image }}
# /usr/bin/cat /tmp/yum_update.log &>> /var/log/container_yum_update.log
# retries: 2
# delay: 3
# ignore_errors: true
- name: Remove temporary yum_update.sh script
file:
path: "{{ yum_update.path }}"