From d7d7592dc7d0c219ac621f3eb4f06aaf5681fa1e Mon Sep 17 00:00:00 2001 From: Steve Baker Date: Thu, 24 Jan 2019 13:15:07 +1300 Subject: [PATCH] Mount in yum_update.sh when running it Rather than copy the ephemeral script yum_update.sh, just mount it in during the buildah run call which runs it. This results in one less layer, and may work around an issue seen in the gate where the file is sometimes not in the image when expected. Change-Id: I1303be08ed162318f4b4b8f3aabf873c13ae9b99 --- tasks/yum_update_buildah.yml | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/tasks/yum_update_buildah.yml b/tasks/yum_update_buildah.yml index bc5d811..d2e9edb 100644 --- a/tasks/yum_update_buildah.yml +++ b/tasks/yum_update_buildah.yml @@ -27,17 +27,6 @@ dest: "{{ yum_update.path }}" mode: 0755 -- name: Copy yum_update.sh - command: > - buildah copy - {{ from_image }} - {{ yum_update.path }} /tmp/yum_update.sh - -- name: Remove temporary yum_update.sh script - file: - path: "{{ yum_update.path }}" - state: absent - - name: List file repos shell: sed -n 's|baseurl=file://||p' *.repo args: @@ -47,6 +36,7 @@ - name: Run yum_update.sh command: > buildah run + --volume {{ yum_update.path }}:/tmp/yum_update.sh --volume {{ yum_repos_dir_path }}:/etc/yum.repos.d {% for repo in file_repos.stdout_lines %} {% if repo|exists %} @@ -58,6 +48,11 @@ {{ from_image }} /tmp/yum_update.sh "{{ update_repo }}" +- name: Remove temporary yum_update.sh script + file: + path: "{{ yum_update.path }}" + state: absent + - name: Commit changes to image {{ target_image | default(source_image) }}{{ modified_append_tag }} command: > buildah commit