Customization for base

Customizations for base, all in same patch

Change-Id: I310a2f51ece8dfe2a159c40407b5bdb77f7ee021
Partially-implements: blueprint third-party-plugin-support
This commit is contained in:
Michal (inc0) Jastrzebski 2016-08-19 18:37:41 +00:00
parent 6f5703eb5d
commit f34d0b0552
4 changed files with 61 additions and 47 deletions

View File

@ -3,6 +3,7 @@ MAINTAINER {{ maintainer }}
LABEL kolla_version="{{ kolla_version }}" LABEL kolla_version="{{ kolla_version }}"
{% import "macros.j2" as macros with context %}
{% block base_header %}{% endblock %} {% block base_header %}{% endblock %}
{{ include_header }} {{ include_header }}
@ -32,24 +33,28 @@ RUN if [ $(awk '{match($0, /[0-9]+/,version)}END{print version[0]}' /etc/system-
#### BEGIN REPO ENABLEMENT #### BEGIN REPO ENABLEMENT
# Turns on Elasticsearch repos # Turns on Elasticsearch repos
COPY elasticsearch.yum.repo /etc/yum.repos.d/elasticsearch.repo {% set base_yum_repo_files = [
'elasticsearch.repo',
'kibana.yum.repo',
'MariaDB.repo',
'influxdb.repo'
] %}
{% for repo_file in base_yum_repo_files | customizable('yum_repo_files') %}
COPY {{ repo_file }} /etc/yum.repos.d/{{ repo_file }}
{% endfor %}
# Turns on Kibana repo {% set base_yum_url_packages = [
COPY kibana.yum.repo /etc/yum.repos.d/kibana.yum.repo 'http://repo.percona.com/release/7/RPMS/x86_64/percona-release-0.1-3.noarch.rpm'
] %}
# Turns on MariaDB repos throughout the RPM build {{ macros.install_packages(base_yum_url_packages | customizable("yum_url_packages")) }}
COPY mariadb.yum.repo /etc/yum.repos.d/MariaDB.repo {% set base_yum_repo_keys = [
'http://yum.mariadb.org/RPM-GPG-KEY-MariaDB',
# Turns on InfluxDB repos throughout the RPM build '/etc/pki/rpm-gpg/RPM-GPG-KEY-Percona ',
COPY influxdb.yum.repo /etc/yum.repos.d/influxdb.repo 'https://packages.elastic.co/GPG-KEY-elasticsearch',
'https://repos.influxdata.com/influxdb.key'
RUN yum -y install \ ] %}
http://repo.percona.com/release/7/RPMS/x86_64/percona-release-0.1-3.noarch.rpm \
&& rpm --import http://yum.mariadb.org/RPM-GPG-KEY-MariaDB \
&& rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-Percona \
&& rpm --import https://packages.elastic.co/GPG-KEY-elasticsearch \
&& rpm --import https://repos.influxdata.com/influxdb.key
RUN true {% for key in base_yum_repo_keys | customizable('yum_repo_keys') %}&& rpm --import {{ key }} {% endfor %}
{% if install_metatype in ['rdo', 'mixed'] %} {% if install_metatype in ['rdo', 'mixed'] %}
{% for cmd in rpm_setup %} {% for cmd in rpm_setup %}
@ -69,16 +74,24 @@ RUN yum-config-manager --enable rhel-7-server-rpms \
{% if base_distro == 'centos' %} {% if base_distro == 'centos' %}
RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 \ RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
&& yum -y install \
epel-release \ {% set base_centos_yup_repo_keys = [
yum-plugin-priorities \ '/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7',
centos-release-ceph-hammer \ '/etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Storage',
centos-release-qemu-ev \ '/etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Virtualization'
&& rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7 \ ] %}
&& rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Storage \
&& rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Virtualization \ {% set base_centos_yum_repo_packages = [
&& yum clean all 'epel-release ',
'yum-plugin-priorities',
'centos-release-ceph-hammer',
'centos-release-qemu-ev'
] %}
{{ macros.install_packages(base_centos_yum_repo_packages | customizable("yum_centos_repo_packages")) }}
RUN true \
{% for key in base_centos_yum_repo_keys | customizable('yum_centos_repo_keys') %} && rpm --import {{ key }}{% endfor %} && yum clean all
{% endif %} {% endif %}
{# Endif for base_distro centos #} {# Endif for base_distro centos #}
@ -149,32 +162,32 @@ RUN yum -y update \
COPY versionlock.list /etc/yum/pluginconf.d/ COPY versionlock.list /etc/yum/pluginconf.d/
{% if install_type == 'binary' %} {% if install_type == 'binary' %}
{% set base_centos_binary_packages = [
'sudo',
'which',
'python',
'lvm2',
'scsi-target-utils',
'iscsi-initiator-utils'
] %}
# Install base packages # Install base packages
RUN yum -y install \ {{ macros.install_packages( base_centos_binary_packages | customizable("centos_binary_packages")) }}
sudo \
which \
python \
lvm2 \
scsi-target-utils \
iscsi-initiator-utils \
&& yum clean all
{% endif %} {% endif %}
{# Endif for install_type binary #} {# Endif for install_type binary #}
{% if install_type == 'source' %} {% if install_type == 'source' %}
{% set base_centos_source_packages = [
'curl',
'sudo',
'tar',
'which',
'lvm2',
'scsi-target-utils',
'iscsi-initiator-utils'
] %}
# Update packages # Update packages
RUN yum -y install \ {{ macros.install_packages( base_centos_source_packages | customizable("centos_source_packages")) }}
curl \
sudo \
tar \
which \
lvm2 \
scsi-target-utils \
iscsi-initiator-utils \
&& yum clean all
{% endif %} {% endif %}
{# endif for install type is source for RPM based distros #} {# endif for install type is source for RPM based distros #}
@ -235,13 +248,13 @@ COPY apt_preferences.{{ base_distro }} /etc/apt/preferences
{% block base_ubuntu_package_installation %} {% block base_ubuntu_package_installation %}
RUN true \ RUN true \
{% for key in base_apt_keys %} {% for key in base_apt_keys | customizable('apt_keys') %}
&& apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 {{ key }} \ && apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 {{ key }} \
{% endfor %} {% endfor %}
&& apt-get update \ && apt-get update \
&& apt-get -y upgrade \ && apt-get -y upgrade \
&& apt-get -y dist-upgrade \ && apt-get -y dist-upgrade \
&& apt-get -y install --no-install-recommends {% for package in base_apt_packages %}{{ package }} {% endfor %} \ && apt-get -y install --no-install-recommends {% for package in base_apt_packages | customizable('apt_packages') %}{{ package }} {% endfor %} \
&& apt-get clean && apt-get clean
{% endblock %} {% endblock %}
@ -264,4 +277,5 @@ RUN touch /usr/local/bin/kolla_extend_start \
&& groupadd kolla \ && groupadd kolla \
&& rm -f /tmp/kolla_bashrc && rm -f /tmp/kolla_bashrc
{% block base_footer %}{% endblock %}
CMD ["kolla_start"] CMD ["kolla_start"]