diff --git a/tasks/yum_install_buildah.yml b/tasks/yum_install_buildah.yml index 3482cdd..237ff11 100644 --- a/tasks/yum_install_buildah.yml +++ b/tasks/yum_install_buildah.yml @@ -38,13 +38,20 @@ chdir: "{{ yum_repos_dir_path }}" register: file_repos +- name: Find if /etc/{{ pkg_mgr_suffix }}/vars exists + stat: + path: /etc/{{ pkg_mgr_suffix }}/vars + register: pkg_mgr_vars_stat + - block: - name: Run yum_install.sh command: > buildah run --volume {{ yum_install.path }}:/tmp/yum_install.sh --volume {{ yum_repos_dir_path }}:/etc/yum.repos.d + {% if pkg_mgr_vars_stat.stat.exists %} --volume /etc/{{ pkg_mgr_suffix }}/vars:/etc/{{ pkg_mgr_suffix }}/vars + {% endif %} {% for repo in file_repos.stdout_lines %} {% if repo is exists %} --volume {{ repo }}:{{ repo }} @@ -62,7 +69,9 @@ buildah --debug run --volume {{ yum_install.path }}:/tmp/yum_install.sh --volume {{ yum_repos_dir_path }}:/etc/yum.repos.d + {% if pkg_mgr_vars_stat.stat.exists %} --volume /etc/{{ pkg_mgr_suffix }}/vars:/etc/{{ pkg_mgr_suffix }}/vars + {% endif %} {% for repo in file_repos.stdout_lines %} {% if repo is exists %} --volume {{ repo }}:{{ repo }} diff --git a/tasks/yum_update_buildah.yml b/tasks/yum_update_buildah.yml index f2811c1..bbb9970 100644 --- a/tasks/yum_update_buildah.yml +++ b/tasks/yum_update_buildah.yml @@ -48,6 +48,11 @@ register: file_repos when: rpms_path is undefined +- name: Find if /etc/{{ pkg_mgr_suffix }}/vars exists + stat: + path: /etc/{{ pkg_mgr_suffix }}/vars + register: pkg_mgr_vars_stat + - name: Define bind-mount modes for yum cache to be populated or used when: yum_cache is defined and yum_cache block: @@ -103,7 +108,9 @@ buildah run --volume {{ yum_update.path }}:/tmp/yum_update.sh --volume {{ yum_repos_dir_path }}:/etc/yum.repos.d + {% if pkg_mgr_vars_stat.stat.exists %} --volume /etc/{{ pkg_mgr_suffix }}/vars:/etc/{{ pkg_mgr_suffix }}/vars + {% endif %} --volume /etc/pki:/etc/pki {% if cache_volume is defined and cache_volume %} --volume {{ cache_volume }} @@ -125,7 +132,9 @@ buildah --debug run --volume {{ yum_update.path }}:/tmp/yum_update.sh --volume {{ yum_repos_dir_path }}:/etc/yum.repos.d + {% if pkg_mgr_vars_stat.stat.exists %} --volume /etc/{{ pkg_mgr_suffix }}/vars:/etc/{{ pkg_mgr_suffix }}/vars + {% endif %} --volume /etc/pki:/etc/pki {% for repo in file_repos.stdout_lines %} {% if repo is exists %}