Merge "Add missing Jinja2 block for repo enablement"

This commit is contained in:
Jenkins 2017-04-13 12:01:22 +00:00 committed by Gerrit Code Review
commit 5e15e813c2

View File

@ -85,15 +85,19 @@ COPY {{ repo_file }} /etc/yum.repos.d/{{ repo_file }}
{% if install_metatype == 'rhos' %} {% if install_metatype == 'rhos' %}
{% block base_rhos_repo_enablement %}
# Turn on the RHOS 7.0 repo for RHOS # Turn on the RHOS 7.0 repo for RHOS
RUN yum-config-manager --enable rhel-7-server-rpms \ RUN yum-config-manager --enable rhel-7-server-rpms \
&& yum-config-manager --enable rhel-7-server-openstack-7.0-rpms && yum-config-manager --enable rhel-7-server-openstack-7.0-rpms
{% endblock %}
{% endif %} {% endif %}
{% if base_distro == 'centos' %} {% if base_distro == 'centos' %}
{% block base_centos_gpg_key_import %}
RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
{% endblock %}
{% set base_centos_yum_repo_keys = [ {% set base_centos_yum_repo_keys = [
'/etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Storage', '/etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Storage',
@ -107,12 +111,12 @@ RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
'yum-plugin-priorities' 'yum-plugin-priorities'
] %} ] %}
{{ macros.install_packages(base_centos_yum_repo_packages | customizable("yum_centos_repo_packages")) }} {{ macros.install_packages(base_centos_yum_repo_packages | customizable("centos_yum_repo_packages")) }}
{% for key in base_centos_yum_repo_keys | customizable('yum_centos_repo_keys') %} {% for key in base_centos_yum_repo_keys | customizable('centos_yum_repo_keys') %}
{%- if loop.first %}RUN {% else %} && {% endif -%} {%- if loop.first %}RUN {% else %} && {% endif -%}
rpm --import {{ key }} \ rpm --import {{ key }} \
{% endfor -%} {% endfor -%}
{%- if base_centos_yum_repo_keys|length ==0 %}RUN {% else %} && {% endif -%} {%- if base_centos_yum_repo_keys|customizable('centos_yum_repo_keys')|length == 0 %}RUN {% else %} && {% endif -%}
yum clean all yum clean all
{% endif %} {% endif %}