Detect local file repos and copy them into the image

This commit is contained in:
Steve Baker 2018-05-11 13:08:58 +12:00
parent 3eea261326
commit 91e4555bde
2 changed files with 23 additions and 0 deletions

View File

@ -28,6 +28,28 @@
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
# discover repos with local packages
repos=$(sed -n 's/baseurl=file:\/\///p' {{ yum_repos_dir_path }}/*.repo)
mkdir repos
for repo in $repos ; do
if [ -d $repo ]; then
target_dir=repos$repo
echo "copying $repo to $target_dir"
mkdir -p $target_dir
cp -a $repo/* $target_dir
fi
done
args:
chdir: "{{ modify_dir_path }}"
when: yum_repos_dir_path is defined
- name: Generate host package json file
block:

View File

@ -8,6 +8,7 @@ COPY compare-package-json.py /tmp/
{% if yum_repos_dir_path is defined %}
COPY yum.repos.d /etc/
COPY repos /
{% endif %}
{% if compare_host_packages %}