aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin André <m.andre@redhat.com>2017-06-15 15:42:06 +0200
committerMartin André <m.andre@redhat.com>2017-06-15 15:44:41 +0200
commit0cba3b2ccdcb556eaf31e520ec97e4e624baa01e (patch)
tree9a640973b7a3f8f1cb649ae53774a3af7756ad59
parentc90c576fb490564b9d4be9ba28940d9425b3f16e (diff)
downloadkolla-0cba3b2ccdcb556eaf31e520ec97e4e624baa01e.tar.gz
kolla-0cba3b2ccdcb556eaf31e520ec97e4e624baa01e.zip
Permit changing yum configuration in the base image
This commit allows to configure yum settings via a yum.conf file that is shipped in the base image and make it overridable with the base_yum_conf jinja2 block. Change-Id: I76a84ec008fec5696cadefdbdeb4204a32421c4b Closes-Bug: #1698134
-rw-r--r--docker/base/Dockerfile.j24
-rw-r--r--docker/base/yum.conf9
-rw-r--r--docker/macros.j22
-rw-r--r--releasenotes/notes/yum_conf-36fef802e8c003f1.yaml4
4 files changed, 18 insertions, 1 deletions
diff --git a/docker/base/Dockerfile.j2 b/docker/base/Dockerfile.j2
index 2f5b5ea98..60603ec5f 100644
--- a/docker/base/Dockerfile.j2
+++ b/docker/base/Dockerfile.j2
@@ -40,6 +40,10 @@ RUN CURRENT_DISTRO_RELEASE=$(awk '{match($0, /[0-9]+/,version)}END{print version
&& cat /tmp/kolla_bashrc >> /etc/bashrc \
&& sed -i 's|^\(override_install_langs=.*\)|# \1|' /etc/yum.conf
+{% block base_yum_conf %}
+COPY yum.conf /etc/yum.conf
+{% endblock %}
+
#### BEGIN REPO ENABLEMENT
{% set base_yum_repo_files = [
] %}
diff --git a/docker/base/yum.conf b/docker/base/yum.conf
new file mode 100644
index 000000000..6714771e8
--- /dev/null
+++ b/docker/base/yum.conf
@@ -0,0 +1,9 @@
+[main]
+keepcache=0
+logfile=/var/log/yum.log
+exactarch=1
+obsoletes=1
+gpgcheck=1
+plugins=1
+installonly_limit=0
+skip_missing_names_on_install=False
diff --git a/docker/macros.j2 b/docker/macros.j2
index 8c323cde6..3be0ef5e1 100644
--- a/docker/macros.j2
+++ b/docker/macros.j2
@@ -1,7 +1,7 @@
{% macro install_packages(packages) -%}
{% if packages is defined and packages|length > 0 -%}
{% if base_distro in ['centos', 'oraclelinux', 'rhel'] -%}
- RUN yum --setopt skip_missing_names_on_install=False -y install {{ packages | join(' ') }} && yum clean all
+ RUN yum -y install {{ packages | join(' ') }} && yum clean all
{%- elif base_distro in ['debian', 'ubuntu'] -%}
{#-
debian_package_install is a utility method to build up an appropriate
diff --git a/releasenotes/notes/yum_conf-36fef802e8c003f1.yaml b/releasenotes/notes/yum_conf-36fef802e8c003f1.yaml
new file mode 100644
index 000000000..8998c3a84
--- /dev/null
+++ b/releasenotes/notes/yum_conf-36fef802e8c003f1.yaml
@@ -0,0 +1,4 @@
+---
+features:
+ - Allow to configure yum settings, and provide a default yum.conf that is
+ overridable via the base_yum_conf jinja2 block.