File tree Expand file tree Collapse file tree 4 files changed +53
-0
lines changed Expand file tree Collapse file tree 4 files changed +53
-0
lines changed Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
3
+ DNSMASQ_PIDFILE=${DNSMASQ_PIDFILE:-/ run/ ironic/ dnsmasq.pid}
4
+ DNSMASQ_PIDFILE_DIR=" $( dirname $DNSMASQ_PIDFILE ) "
5
+
3
6
if [[ ! -d " /var/log/kolla/ironic" ]]; then
4
7
mkdir -p /var/log/kolla/ironic
5
8
fi
@@ -10,3 +13,19 @@ if [[ ! -r "/var/log/kolla/ironic/dnsmasq.log" ]]; then
10
13
touch /var/log/kolla/ironic/dnsmasq.log
11
14
chown ironic:ironic /var/log/kolla/ironic/dnsmasq.log
12
15
fi
16
+
17
+ if [[ ! -d " $DNSMASQ_PIDFILE_DIR " ]]; then
18
+ mkdir -p " $DNSMASQ_PIDFILE_DIR "
19
+ fi
20
+
21
+ # NOTE(wszumski): This writes the PID of dnsmasq out to a file. The PIDFILE can be used in
22
+ # another container to send a signal to dnsmasq to reload its config (providing that the two
23
+ # containers share a PID namespace). The concrete use case is for the Ironic PXE filter to
24
+ # clean up stale host entries on startup as documented in:
25
+ #
26
+ # https://docs.openstack.org/ironic/latest/admin/inspection/pxe_filter.html
27
+ #
28
+ # We cannot use the pid-file option in dnsmasq, since it will only write the PIDFILE if you
29
+ # run dnsmasq in its non-forking mode i.e you do use the --no-daemon or --keep-in-foreground
30
+ # options.
31
+ echo $$ > " $DNSMASQ_PIDFILE "
Original file line number Diff line number Diff line change
1
+ FROM {{ namespace }}/{{ image_prefix }}ironic-base:{{ tag }}
2
+ {% block labels %}
3
+ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build_date }}"
4
+ {% endblock %}
5
+
6
+ {% block ironic_pxe_filter_header %}{% endblock %}
7
+
8
+ {% import "macros.j2" as macros with context %}
9
+
10
+ {% set ironic_pxe_filter_packages = [] %}
11
+
12
+ {% set ironic_pxe_filter_pip_packages = [] %}
13
+
14
+ RUN {{ macros.install_pip(ironic_pxe_filter_pip_packages | customizable("pip_packages")) }}
15
+
16
+ {{ macros.install_packages(ironic_pxe_filter_packages | customizable("packages")) }}
17
+
18
+ {{ macros.kolla_patch_sources() }}
19
+
20
+ COPY extend_start.sh /usr/local/bin/kolla_ironic_extend_start
21
+ RUN chmod 644 /usr/local/bin/kolla_ironic_extend_start
22
+
23
+ {% block ironic_pxe_filter_footer %}{% endblock %}
24
+ {% block footer %}{% endblock %}
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ IRONIC_DHCP_HOSTS_DIR=${IRONIC_DHCP_HOSTS_DIR:-/ etc/ dnsmasq/ dhcp-hostsdir}
3
+ DNSMASQ_PIDFILE=${DNSMASQ_PIDFILE:-/ run/ ironic/ dnsmasq.pid}
4
+
5
+ # NOTE(wszumski): This container must be in same process namespace as dnsmasq
6
+ rm -f $IRONIC_DHCP_HOSTS_DIR /* && kill -HUP $( cat " $DNSMASQ_PIDFILE " ) || true
Original file line number Diff line number Diff line change
1
+ ---
2
+ features :
3
+ - |
4
+ Adds ``ironic-pxe-filter`` container image.
You can’t perform that action at this time.
0 commit comments