From ce2a00a0e99709e66dca4f4597c122dafe59472a Mon Sep 17 00:00:00 2001 From: Christian Berendt Date: Wed, 29 Jun 2016 14:01:02 +0200 Subject: [PATCH] Add neutron-vpnaas-agent container This implements the neutron-vpnaas-agent container for Ubuntu/Debian with installation from source packages. Co-Authored-By: zhubingbing Implements: blueprint neutron-vpnaas-agent Change-Id: I3e4b513fb8e1670c4df0edb4951610f777ff72e6 --- docker/neutron/neutron-base/Dockerfile.j2 | 4 +- .../neutron-vpnaas-agent/Dockerfile.j2 | 39 +++++++++++++++++++ .../neutron-vpnaas-agent/extend_start.sh | 8 ++++ kolla/common/config.py | 4 ++ 4 files changed, 52 insertions(+), 3 deletions(-) create mode 100644 docker/neutron/neutron-vpnaas-agent/Dockerfile.j2 create mode 100644 docker/neutron/neutron-vpnaas-agent/extend_start.sh diff --git a/docker/neutron/neutron-base/Dockerfile.j2 b/docker/neutron/neutron-base/Dockerfile.j2 index 5e9b6218e5..f6656b8372 100644 --- a/docker/neutron/neutron-base/Dockerfile.j2 +++ b/docker/neutron/neutron-base/Dockerfile.j2 @@ -16,14 +16,12 @@ MAINTAINER {{ maintainer }} {% elif base_distro in ['ubuntu'] %} -# TODO(Jeffrey4l): UCA latest Newton release lack of neutron-lbaas-common -# package, just remove neutron-lbaas-agent in neutron_base_packages. Once they -# fix it, this should be reverted. {% set neutron_base_packages = [ 'iproute2', 'neutron-plugin-ml2', 'neutron-server', 'openvswitch-switch', + 'neutron-lbaas-common', 'python-openvswitch' ] %} diff --git a/docker/neutron/neutron-vpnaas-agent/Dockerfile.j2 b/docker/neutron/neutron-vpnaas-agent/Dockerfile.j2 new file mode 100644 index 0000000000..7693000d98 --- /dev/null +++ b/docker/neutron/neutron-vpnaas-agent/Dockerfile.j2 @@ -0,0 +1,39 @@ +FROM {{ namespace }}/{{ image_prefix }}neutron-base:{{ tag }} +MAINTAINER {{ maintainer }} + +{% block neutorn_vpnass_agent_header %}{% endblock %} + +{% import "macros.j2" as macros with context %} + +{% if install_type == 'binary' %} + {% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %} + {% set neutron_vpnaas_agent_packages = [ + 'openswan', + 'openstack-neutron-vpn-agent' + ] %} + {% elif base_distro in ['ubuntu', 'debian'] %} + {% set neutron_vpnaas_agent_packages = [ + 'strongswan', + 'neutron-vpn-agent' + ] %} + {% endif %} + +{{ macros.install_packages(neutron_vpnaas_agent_packages | customizable("packages")) }} + +{% elif install_type == 'source' %} + +ADD neutron-vpnaas-agent-archive /neutron-vpnaas-agent-source +RUN ln -s neutron-vpnaas-agent-source/* neutron_vpnaas \ + && /var/lib/kolla/venv/bin/pip --no-cache-dir install --upgrade -c requirements/upper-constraints.txt /neutron_vpnaas \ + && cp /neutron_vpnaas/etc/neutron/rootwrap.d/* /etc/neutron/rootwrap.d + +{% endif %} + +COPY extend_start.sh /usr/local/bin/kolla_neutron_extend_start +RUN chmod 755 /usr/local/bin/kolla_neutron_extend_start + +{% block neutron_vpnaas_agent_footer %}{% endblock %} +{% block footer %}{% endblock %} +{{ include_footer }} + +USER neutron diff --git a/docker/neutron/neutron-vpnaas-agent/extend_start.sh b/docker/neutron/neutron-vpnaas-agent/extend_start.sh new file mode 100644 index 0000000000..40ba0b696e --- /dev/null +++ b/docker/neutron/neutron-vpnaas-agent/extend_start.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +# Bootstrap and exit if KOLLA_BOOTSTRAP variable is set. This catches all cases +# of the KOLLA_BOOTSTRAP variable being set, including empty. +if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then + neutron-db-manage --subproject neutron-vpnaas --config-file /etc/neutron/neutron.conf upgrade head + exit 0 +fi diff --git a/kolla/common/config.py b/kolla/common/config.py index 5985c2b3d6..b125f00017 100644 --- a/kolla/common/config.py +++ b/kolla/common/config.py @@ -245,6 +245,10 @@ SOURCES = { 'type': 'url', 'location': ('http://tarballs.openstack.org/networking-sfc/' 'networking-sfc-master.tar.gz')}, + 'neutron-vpnaas-agent': { + 'type': 'url', + 'location': ('http://tarballs.openstack.org/neutron-vpnaas/' + 'neutron-vpnaas-master.tar.gz')}, 'nova-base': { 'type': 'url', 'location': ('http://tarballs.openstack.org/nova/'