From 040ff6ea037357a84a6450c944648b83eb833454 Mon Sep 17 00:00:00 2001 From: Mauricio Lima Date: Fri, 13 Jan 2017 15:32:35 -0300 Subject: [PATCH] Fix ironic inspector Co-Authored-By: Jeffrey Zhang Closes-Bug: #1650345 Change-Id: Id03619b4e26a0a77c2a39e2de21efd13be0e9200 --- docker/dnsmasq/Dockerfile.j2 | 12 ++++++++++++ docker/ironic/ironic-inspector/Dockerfile.j2 | 5 ++++- docker/ironic/ironic-inspector/extend_start.sh | 8 ++++++++ 3 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 docker/dnsmasq/Dockerfile.j2 create mode 100644 docker/ironic/ironic-inspector/extend_start.sh diff --git a/docker/dnsmasq/Dockerfile.j2 b/docker/dnsmasq/Dockerfile.j2 new file mode 100644 index 0000000000..bcf62102d1 --- /dev/null +++ b/docker/dnsmasq/Dockerfile.j2 @@ -0,0 +1,12 @@ +FROM {{ namespace }}/{{ image_prefix }}base:{{ tag }} +MAINTAINER {{ maintainer }} + +{% block dnsmasq_header %}{% endblock %} + +{% import "macros.j2" as macros with context %} + +{% set dnsmasq_packages = ['dnsmasq'] %} +{{ macros.install_packages(dnsmasq_packages| customizable("packages")) }} + +{% block dnsmasq_footer %}{% endblock %} +{% block footer %}{% endblock %} diff --git a/docker/ironic/ironic-inspector/Dockerfile.j2 b/docker/ironic/ironic-inspector/Dockerfile.j2 index 8870787974..3eae4dab3d 100644 --- a/docker/ironic/ironic-inspector/Dockerfile.j2 +++ b/docker/ironic/ironic-inspector/Dockerfile.j2 @@ -35,8 +35,11 @@ RUN ln -s ironic-inspector-source/* ironic-inspector \ {% endif %} COPY ironic_sudoers /etc/sudoers.d/kolla_ironic_inspector_sudoers +COPY extend_start.sh /usr/local/bin/kolla_ironic_extend_start + RUN chmod 750 /etc/sudoers.d \ - && chmod 440 /etc/sudoers.d/kolla_ironic_inspector_sudoers + && chmod 440 /etc/sudoers.d/kolla_ironic_inspector_sudoers \ + && chmod 755 /usr/local/bin/kolla_ironic_extend_start {% block ironic_inspector_footer %}{% endblock %} {% block footer %}{% endblock %} diff --git a/docker/ironic/ironic-inspector/extend_start.sh b/docker/ironic/ironic-inspector/extend_start.sh new file mode 100644 index 0000000000..b87060adbf --- /dev/null +++ b/docker/ironic/ironic-inspector/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 + ironic-inspector-dbsync --config-file /etc/ironic-inspector/inspector.conf upgrade + exit 0 +fi