aboutsummaryrefslogtreecommitdiff
path: root/docker
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2017-06-27 17:50:25 +0000
committerGerrit Code Review <review@openstack.org>2017-06-27 17:50:25 +0000
commit6b8d38c405eb886607fe4c6306f68ea8ad7c8816 (patch)
tree9475d067ed1fe8ebe74aade5f5ab1164e8064516 /docker
parenta974fb216f9fa457dda1f1cd80c35186fcd73cc4 (diff)
parent80805318232c2dfecbbf86cc2bb9e3e95e264a98 (diff)
downloadkolla-6b8d38c405eb886607fe4c6306f68ea8ad7c8816.tar.gz
kolla-6b8d38c405eb886607fe4c6306f68ea8ad7c8816.zip
Merge "Add opendaylight install fix"
Diffstat (limited to 'docker')
-rw-r--r--docker/macros.j29
-rw-r--r--docker/opendaylight/Dockerfile.j29
2 files changed, 18 insertions, 0 deletions
diff --git a/docker/macros.j2 b/docker/macros.j2
index 3be0ef5e1..9120b5142 100644
--- a/docker/macros.j2
+++ b/docker/macros.j2
@@ -49,6 +49,15 @@ RUN apt-get -y install --no-install-recommends haproxy \
&& apt-get clean
{% endmacro %}
+{% macro debian_opendaylight_existing_user_fix() %}
+{# NOTE(egonzalez): The postinst script breaks if the user 'odl' already exists #}
+RUN apt-get update \
+ && apt-get -y install --no-install-recommends opendaylight \
+ || sed -i '/^\s*adduser/,+1 d' /var/lib/dpkg/info/opendaylight.postinst \
+ && apt-get -y install -f \
+ && apt-get clean
+{% endmacro %}
+
{% macro install_kubectl() %}
{% if base_arch == 'x86_64' %}
ENV KUBE_ARCH=amd64
diff --git a/docker/opendaylight/Dockerfile.j2 b/docker/opendaylight/Dockerfile.j2
index 5b6b9f46f..311f8ffdc 100644
--- a/docker/opendaylight/Dockerfile.j2
+++ b/docker/opendaylight/Dockerfile.j2
@@ -25,6 +25,15 @@ COPY {{ opendaylight_repo }} /etc/yum.repos.d/
{% endif %}
{% endif %}
RUN sh -c "echo 'deb {{ odl_release_deb_url }} /' > /etc/apt/sources.list.d/opendaylight.list"
+
+# NOTE(egonzalez): ODL fails to install in debian family images with
+# existing odl user. First install odl and then allow usage of
+# install_packages macro for custom configs.
+ {% block debian_opendaylight_install_fix_block %}
+ {% if base_distro in ['debian', 'ubuntu'] %}
+ {{ macros.debian_opendaylight_existing_user_fix() }}
+ {% endif %}
+ {% endblock %}
{% endif %}
{{ macros.install_packages(opendaylight_packages | customizable("packages")) }}