summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Baker <sbaker@redhat.com>2019-01-24 13:15:07 +1300
committerSteve Baker <sbaker@redhat.com>2019-01-24 13:15:07 +1300
commitd7d7592dc7d0c219ac621f3eb4f06aaf5681fa1e (patch)
treea9938a05d13cb99da5616e4466a813ac439c080c
parent8dba05a3c0b7ea72b98181374e2916c16b6a0671 (diff)
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
Notes
Notes (review): Code-Review+2: Alex Schultz <aschultz@redhat.com> Workflow+1: Emilien Macchi <emilien@redhat.com> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Fri, 25 Jan 2019 16:50:10 +0000 Reviewed-on: https://review.openstack.org/632832 Project: openstack/ansible-role-tripleo-modify-image Branch: refs/heads/master
-rw-r--r--tasks/yum_update_buildah.yml17
1 files 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 @@
27 dest: "{{ yum_update.path }}" 27 dest: "{{ yum_update.path }}"
28 mode: 0755 28 mode: 0755
29 29
30- name: Copy yum_update.sh
31 command: >
32 buildah copy
33 {{ from_image }}
34 {{ yum_update.path }} /tmp/yum_update.sh
35
36- name: Remove temporary yum_update.sh script
37 file:
38 path: "{{ yum_update.path }}"
39 state: absent
40
41- name: List file repos 30- name: List file repos
42 shell: sed -n 's|baseurl=file://||p' *.repo 31 shell: sed -n 's|baseurl=file://||p' *.repo
43 args: 32 args:
@@ -47,6 +36,7 @@
47- name: Run yum_update.sh 36- name: Run yum_update.sh
48 command: > 37 command: >
49 buildah run 38 buildah run
39 --volume {{ yum_update.path }}:/tmp/yum_update.sh
50 --volume {{ yum_repos_dir_path }}:/etc/yum.repos.d 40 --volume {{ yum_repos_dir_path }}:/etc/yum.repos.d
51 {% for repo in file_repos.stdout_lines %} 41 {% for repo in file_repos.stdout_lines %}
52 {% if repo|exists %} 42 {% if repo|exists %}
@@ -58,6 +48,11 @@
58 {{ from_image }} 48 {{ from_image }}
59 /tmp/yum_update.sh "{{ update_repo }}" 49 /tmp/yum_update.sh "{{ update_repo }}"
60 50
51- name: Remove temporary yum_update.sh script
52 file:
53 path: "{{ yum_update.path }}"
54 state: absent
55
61- name: Commit changes to image {{ target_image | default(source_image) }}{{ modified_append_tag }} 56- name: Commit changes to image {{ target_image | default(source_image) }}{{ modified_append_tag }}
62 command: > 57 command: >
63 buildah commit 58 buildah commit