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 }}"
{% import "macros.j2" as macros with context %}
{% block base_header %}{% endblock %}
{{ include_header }}
@ -32,24 +33,28 @@ RUN if [ $(awk '{match($0, /[0-9]+/,version)}END{print version[0]}' /etc/system-
#### BEGIN REPO ENABLEMENT
# 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
COPY kibana.yum.repo /etc/yum.repos.d/kibana.yum.repo
# Turns on MariaDB repos throughout the RPM build
COPY mariadb.yum.repo /etc/yum.repos.d/MariaDB.repo
# Turns on InfluxDB repos throughout the RPM build
COPY influxdb.yum.repo /etc/yum.repos.d/influxdb.repo
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
{% set base_yum_url_packages = [
'http://repo.percona.com/release/7/RPMS/x86_64/percona-release-0.1-3.noarch.rpm'
] %}
{{ macros.install_packages(base_yum_url_packages | customizable("yum_url_packages")) }}
{% set base_yum_repo_keys = [
'http://yum.mariadb.org/RPM-GPG-KEY-MariaDB',
'/etc/pki/rpm-gpg/RPM-GPG-KEY-Percona ',
'https://packages.elastic.co/GPG-KEY-elasticsearch',
'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'] %}
{% for cmd in rpm_setup %}
@ -69,16 +74,24 @@ RUN yum-config-manager --enable rhel-7-server-rpms \
{% if base_distro == 'centos' %}
RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 \
&& yum -y install \
epel-release \
yum-plugin-priorities \
centos-release-ceph-hammer \
centos-release-qemu-ev \
&& 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 \
&& yum clean all
RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
{% set base_centos_yup_repo_keys = [
'/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7',
'/etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Storage',
'/etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Virtualization'
] %}
{% set base_centos_yum_repo_packages = [
'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 for base_distro centos #}
@ -149,32 +162,32 @@ RUN yum -y update \
COPY versionlock.list /etc/yum/pluginconf.d/
{% if install_type == 'binary' %}
{% set base_centos_binary_packages = [
'sudo',
'which',
'python',
'lvm2',
'scsi-target-utils',
'iscsi-initiator-utils'
] %}
# Install base packages
RUN yum -y install \
sudo \
which \
python \
lvm2 \
scsi-target-utils \
iscsi-initiator-utils \
&& yum clean all
{{ macros.install_packages( base_centos_binary_packages | customizable("centos_binary_packages")) }}
{% endif %}
{# Endif for install_type binary #}
{% if install_type == 'source' %}
{% set base_centos_source_packages = [
'curl',
'sudo',
'tar',
'which',
'lvm2',
'scsi-target-utils',
'iscsi-initiator-utils'
] %}
# Update packages
RUN yum -y install \
curl \
sudo \
tar \
which \
lvm2 \
scsi-target-utils \
iscsi-initiator-utils \
&& yum clean all
{{ macros.install_packages( base_centos_source_packages | customizable("centos_source_packages")) }}
{% endif %}
{# 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 %}
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 }} \
{% endfor %}
&& apt-get update \
&& apt-get -y 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
{% endblock %}
@ -264,4 +277,5 @@ RUN touch /usr/local/bin/kolla_extend_start \
&& groupadd kolla \
&& rm -f /tmp/kolla_bashrc
{% block base_footer %}{% endblock %}
CMD ["kolla_start"]