diff --git a/tasks/yum_update.yml b/tasks/yum_update.yml index fc142ec..cf7e428 100644 --- a/tasks/yum_update.yml +++ b/tasks/yum_update.yml @@ -14,18 +14,13 @@ set_fact: modify_dir_path: "{{ context_dir.path }}" - -- name: Copy directory used for /etc/yum.repos.d - copy: - src: "{{ yum_repos_dir_path }}" - dest: "{{ modify_dir_path }}/yum.repos.d" - when: yum_repos_dir_path is defined - - name: Copy local file repos to context directory shell: | #!/bin/sh set -ex + cp -a {{ yum_repos_dir_path }} {{ modify_dir_path }}/yum.repos.d + # discover repos with local packages repos=$(sed -n 's/baseurl=file:\/\///p' {{ yum_repos_dir_path }}/*.repo) diff --git a/templates/Dockerfile-yum.j2 b/templates/Dockerfile-yum.j2 index e236212..ca61564 100644 --- a/templates/Dockerfile-yum.j2 +++ b/templates/Dockerfile-yum.j2 @@ -8,7 +8,7 @@ COPY compare-package-json.py /tmp/ {% if yum_repos_dir_path is defined %} RUN rm -rf /etc/yum.repos.d/ -COPY yum.repos.d /etc/ +COPY yum.repos.d /etc/yum.repos.d COPY repos / {% endif %}