Browse Source

yum_update: cp the script in /tmp before buildah cp

In I8a3769c0b55572ba05cc29ecd28a131cc94e8c4d, we switched the playbook
to use buildah CLI and run the yum_update.sh from a directory that
wasn't found by the playbook:

  no files found matching "files/yum_update.sh":
  no such file or directory

This patch first copies the script in /tmp, so it can be copied from the
host afterward.

Change-Id: I6da0850386c0e3ca51f5f42dbd97c26bf5364a24
changes/99/632099/8
Emilien Macchi 4 months ago
parent
commit
f77b9a22e9
1 changed files with 17 additions and 1 deletions
  1. 17
    1
      tasks/yum_update_buildah.yml

+ 17
- 1
tasks/yum_update_buildah.yml View File

@@ -16,11 +16,27 @@
16 16
       --label modified_append_tag={{ modified_append_tag }}
17 17
       --workingdir / {{ from_image }}
18 18
 
19
+- name: Create tempfile name for yum_update.sh
20
+  tempfile:
21
+    state: file
22
+  register: yum_update
23
+
24
+- name: Prepare yum_update.sh script
25
+  copy:
26
+    src: files/yum_update.sh
27
+    dest: "{{ yum_update.path }}"
28
+    mode: 0755
29
+
19 30
 - name: Copy yum_update.sh
20 31
   command: >
21 32
     buildah copy
22 33
       {{ from_image }}
23
-      files/yum_update.sh /tmp/yum_update.sh
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
24 40
 
25 41
 - name: List file repos
26 42
   shell: sed -n 's|baseurl=file://||p' *.repo

Loading…
Cancel
Save