Merge "Customizations for Neutron"

This commit is contained in:
Jenkins 2016-08-31 12:57:51 +00:00 committed by Gerrit Code Review
commit 1a380935f7
8 changed files with 148 additions and 121 deletions

View File

@ -1,61 +1,73 @@
FROM {{ namespace }}/{{ image_prefix }}openstack-base:{{ tag }}
MAINTAINER {{ maintainer }}
{% import "macros.j2" as macros with context %}
{% if install_type == 'binary' %}
{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
RUN yum -y install \
openstack-neutron \
openstack-neutron-ml2 \
openvswitch \
openstack-neutron-lbaas \
python-openvswitch \
&& yum clean all
{% set neutron_base_packages = [
'openstack-neutron',
'openstack-neutron-lbaas',
'openstack-neutron-ml2',
'openvswitch',
'python-openvswitch'
] %}
{% elif base_distro in ['ubuntu'] %}
RUN apt-get -y install --no-install-recommends \
iproute2 \
neutron-plugin-ml2 \
neutron-server \
openvswitch-switch \
python-openvswitch \
neutron-lbaas-agent \
&& apt-get clean \
&& mkdir -p /usr/share/neutron \
{% set neutron_base_packages = [
'iproute2',
'neutron-lbaas-agent',
'neutron-plugin-ml2',
'neutron-server',
'openvswitch-switch',
'python-openvswitch'
] %}
{% endif %}
{{ macros.install_packages(neutron_base_packages | customizable("packages")) }}
{% if base_distro in ['ubuntu'] %}
RUN mkdir -p /usr/share/neutron \
&& ln -s /etc/neutron/api-paste.ini /usr/share/neutron/api-paste.ini
{% endif %}
{% elif install_type == 'source' %}
{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
RUN yum -y install \
conntrack-tools \
dnsmasq \
dnsmasq-utils \
ipset \
openvswitch \
python-openvswitch \
uuid \
&& yum clean all
{% set neutron_base_packages = [
'conntrack-tools',
'dnsmasq',
'dnsmasq-utils',
'ipset',
'openvswitch',
'python-openvswitch',
'uuid'
] %}
{% elif base_distro in ['ubuntu', 'debian'] %}
RUN apt-get -y install --no-install-recommends \
iputils-arping \
conntrack \
dnsmasq \
dnsmasq-utils \
iproute2 \
ipset \
iptables \
openvswitch-switch \
python-openvswitch \
uuid-runtime \
&& apt-get clean
{% set neutron_base_packages = [
'conntrack',
'dnsmasq',
'dnsmasq-utils',
'iproute2',
'ipset',
'iptables',
'iputils-arping',
'openvswitch-switch',
'python-openvswitch',
'uuid-runtime'
] %}
{% endif %}
{{ macros.install_packages(neutron_base_packages | customizable("packages")) }}
ADD neutron-base-archive /neutron-base-source
RUN ln -s neutron-base-source/* neutron \
&& useradd --user-group neutron \
@ -78,3 +90,5 @@ RUN usermod -a -G kolla neutron \
&& chmod 440 /etc/sudoers.d/kolla_neutron_sudoers \
&& touch /usr/local/bin/kolla_neutron_extend_start \
&& chmod 755 /usr/local/bin/kolla_extend_start /usr/local/bin/kolla_neutron_extend_start
{% block neutron_base_footer %}{% endblock %}

View File

@ -1,16 +1,22 @@
FROM {{ namespace }}/{{ image_prefix }}neutron-base:{{ tag }}
MAINTAINER {{ maintainer }}
{% import "macros.j2" as macros with context %}
{% if base_distro in ['ubuntu', 'debian'] %}
{% if install_type == 'binary' %}
RUN apt-get -y install --no-install-recommends \
neutron-dhcp-agent \
&& apt-get clean
{% set neutron_dhcp_agent_packages = [
'neutron-dhcp-agent'
] %}
{{ macros.install_packages(neutron_dhcp_agent_packages | customizable("packages")) }}
{% endif %}
{% endif %}
{% block neutron_dhcp_agent_footer %}{% endblock %}
{% block footer %}{% endblock %}
{{ include_footer }}
USER neutron

View File

@ -1,30 +1,29 @@
FROM {{ namespace }}/{{ image_prefix }}neutron-base:{{ tag }}
MAINTAINER {{ maintainer }}
{% import "macros.j2" as macros with context %}
{% if install_type == 'binary' %}
{% if base_distro in ['ubuntu', 'debian'] %}
RUN apt-get -y install --no-install-recommends \
neutron-l3-agent \
&& apt-get clean
{% set neutron_l3_agent_packages = [
'neutron-l3-agent'
] %}
{% endif %}
{% elif install_type == 'source' %}
{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
RUN yum -y install \
keepalived \
&& yum clean all
{% set neutron_l3_agent_packages = [
'keepalived'
] %}
{% elif base_distro in ['ubuntu', 'debian'] %}
RUN apt-get -y install --no-install-recommends \
keepalived \
&& apt-get clean
{% endif %}
{% endif %}
{{ macros.install_packages(neutron_l3_agent_packages | customizable("packages")) }}
{% block neutron_l3_agent_footer %}{% endblock %}
{% block footer %}{% endblock %}
{{ include_footer }}
USER neutron

View File

@ -1,41 +1,32 @@
FROM {{ namespace }}/{{ image_prefix }}neutron-base:{{ tag }}
MAINTAINER {{ maintainer }}
{% import "macros.j2" as macros with context %}
{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
RUN yum -y install \
haproxy \
net-tools \
&& yum clean all
{% elif base_distro in ['ubuntu'] %}
RUN apt-get -y install --no-install-recommends \
haproxy \
net-tools \
&& apt-get clean
{% endif %}
{% set neutron_lbaas_agent_packages = [
'haproxy',
'net-tools'
] %}
{{ macros.install_packages(neutron_lbaas_agent_packages | customizable("packages")) }}
{% if install_type == 'binary' %}
{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
RUN yum -y install \
openstack-neutron-lbaas \
net-tools \
&& yum clean all
{% set neutron_lbaas_agent_packages = [
'openstack-neutron-lbaas'
] %}
{% elif base_distro in ['ubuntu'] %}
RUN apt-get -y install --no-install-recommends \
neutron-lbaas-common \
neutron-lbaasv2-agent \
python-neutron-lbaas \
net-tools \
&& apt-get clean
{% set neutron_lbaas_agent_packages = [
'neutron-lbaas-common',
'neutron-lbaasv2-agent',
'python-neutron-lbaas'
] %}
{% endif %}
{{ macros.install_packages(neutron_lbaas_agent_packages | customizable("packages")) }}
{% elif install_type == 'source' %}
ADD neutron-lbaas-agent-archive /neutron-lbaas-agent-source
@ -49,6 +40,8 @@ RUN ln -s neutron-lbaas-agent-source/* neutron_lbaas \
COPY extend_start.sh /usr/local/bin/kolla_neutron_extend_start
RUN chmod 755 /usr/local/bin/kolla_neutron_extend_start
{% block neutron_lbaas_agent_footer %}{% endblock %}
{% block footer %}{% endblock %}
{{ include_footer }}
USER neutron

View File

@ -1,41 +1,38 @@
FROM {{ namespace }}/{{ image_prefix }}neutron-base:{{ tag }}
MAINTAINER {{ maintainer }}
{% import "macros.j2" as macros with context %}
{% if install_type == 'binary' %}
{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
# Install required packages
RUN yum -y install \
ebtables \
openstack-neutron-linuxbridge \
&& yum clean all
{% set neutron_linuxbridge_agent_packages = [
'ebtables',
'openstack-neutron-linuxbridge'
] %}
{% elif base_distro in ['ubuntu'] %}
RUN apt-get -y install --no-install-recommends \
ebtables \
neutron-plugin-linuxbridge-agent \
&& apt-get clean
{% set neutron_linuxbridge_agent_packages = [
'ebtables',
'neutron-plugin-linuxbridge-agent'
] %}
{% endif %}
{% elif install_type == 'source' %}
{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
# Install required packages
RUN yum -y install \
ebtables \
bridge-utils \
&& yum clean all
{% set neutron_linuxbridge_agent_packages = [
'bridge-utils',
'ebtables'
] %}
{% elif base_distro in ['ubuntu'] %}
RUN apt-get -y install \
ebtables \
bridge-utils \
&& apt-get clean
{% endif %}
{% endif %}
{{ macros.install_packages(neutron_linuxbridge_agent_packages | customizable("packages")) }}
{% block neutron_linuxbridge_agent_footer %}{% endblock %}
{% block footer %}{% endblock %}
{{ include_footer }}
USER neutron

View File

@ -1,16 +1,20 @@
FROM {{ namespace }}/{{ image_prefix }}neutron-base:{{ tag }}
MAINTAINER {{ maintainer }}
{% import "macros.j2" as macros with context %}
{% if base_distro in ['ubuntu', 'debian'] %}
{% if install_type == 'binary' %}
RUN apt-get -y install --no-install-recommends \
neutron-metadata-agent \
&& apt-get clean
{% set neutron_metadata_agent_packages = [
'neutron-metadata-agent'
] %}
{% endif %}
{% endif %}
{{ macros.install_packages(neutron_metadata_agent_packages | customizable("packages")) }}
COPY neutron_sudoers /etc/sudoers.d/neutron_sudoers
COPY extend_start.sh /usr/local/bin/kolla_neutron_extend_start
RUN chmod 755 /usr/local/bin/kolla_neutron_extend_start \
@ -18,6 +22,8 @@ RUN chmod 755 /usr/local/bin/kolla_neutron_extend_start \
&& chmod 440 /etc/sudoers.d/neutron_sudoers \
&& usermod -a -G kolla neutron
{% block neutron_metadata_agent_footer %}{% endblock %}
{% block footer %}{% endblock %}
{{ include_footer }}
USER neutron

View File

@ -1,25 +1,30 @@
FROM {{ namespace }}/{{ image_prefix }}neutron-base:{{ tag }}
MAINTAINER {{ maintainer }}
{% import "macros.j2" as macros with context %}
{% if install_type == 'binary' %}
{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
# Install required packages
RUN yum -y install \
openstack-neutron-openvswitch \
openvswitch \
&& yum clean all
{% set neutron_openvswitch_agent_packages = [
'openstack-neutron-openvswitch',
'openvswitch'
] %}
{% elif base_distro in ['ubuntu'] %}
RUN apt-get -y install --no-install-recommends \
openvswitch-switch \
neutron-plugin-openvswitch-agent \
&& apt-get clean
{% set neutron_openvswitch_agent_packages = [
'neutron-plugin-openvswitch-agent',
'openvswitch-switch'
] %}
{% endif %}
{% endif %}
{{ macros.install_packages(neutron_openvswitch_agent_packages | customizable("packages")) }}
{% block neutron_openvswitch_agent_footer %}{% endblock %}
{% block footer %}{% endblock %}
{{ include_footer }}
USER neutron

View File

@ -1,23 +1,28 @@
FROM {{ namespace }}/{{ image_prefix }}neutron-base:{{ tag }}
MAINTAINER {{ maintainer }}
{% import "macros.j2" as macros with context %}
{% if install_type == 'binary' %}
{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
RUN yum -y install \
openstack-neutron-lbaas \
&& yum clean all
{% set neutron_server_packages = [
'openstack-neutron-lbaas'
] %}
{% elif base_distro in ['ubuntu'] %}
RUN apt-get -y install --no-install-recommends \
neutron-lbaas-common \
neutron-lbaasv2-agent \
python-neutron-lbaas \
&& apt-get clean \
{% set neutron_server_packages = [
'neutron-lbaas-common',
'neutron-lbaasv2-agent',
'python-neutron-lbaas'
] %}
{% endif %}
{% endif %}
{{ macros.install_packages(neutron_server_packages | customizable("packages")) }}
ADD plugins-archive /
COPY extend_start.sh /usr/local/bin/kolla_neutron_extend_start
RUN chmod 755 /usr/local/bin/kolla_neutron_extend_start \
@ -25,6 +30,8 @@ RUN chmod 755 /usr/local/bin/kolla_neutron_extend_start \
pip --no-cache-dir install --upgrade -c requirements/upper-constraints.txt /plugins/*; \
fi
{% block neutron_server_footer %}{% endblock %}
{% block footer %}{% endblock %}
{{ include_footer }}
USER neutron