Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply latest changes from metal3-io #1

Merged
merged 20 commits into from
Jul 8, 2019
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
694bf46
Add more configuration options to containers.
imain May 15, 2019
833368a
Merge pull request #48 from imain/interface
dtantsur Jun 6, 2019
c7e37f4
Publish ironic endpoint via mDNS
dtantsur Jun 5, 2019
657942a
Fetch ironic-inspector endpoint from mDNS
dtantsur Jun 5, 2019
d1745c5
Merge pull request #50 from dtantsur/master
bfournie Jun 6, 2019
915f314
Install iptables explicitly and correct the iptables lines
dtantsur Jun 6, 2019
942f551
Merge pull request #51 from dtantsur/master
bfournie Jun 6, 2019
456cfd3
Update all packages when building an image
dtantsur Jun 11, 2019
e35e4c5
Do not use hard coded Python 2
elfosardo Jun 11, 2019
acc93c8
Merge pull request #53 from elfosardo/use-generic-python
dtantsur Jun 12, 2019
9cb10d3
Merge pull request #52 from dtantsur/update
dtantsur Jun 12, 2019
8f97a3a
Stop defining inspection kernel params in ironic-image
dtantsur Jun 17, 2019
aed0941
Merge pull request #58 from dtantsur/collectors
dtantsur Jun 18, 2019
27ba01c
Allow running ironic API, conductor and exporter separately
dtantsur Jun 27, 2019
93a6cfe
Clarify TODO on removing the all-in-one entrypoint
dtantsur Jul 8, 2019
e52ba53
Merge pull request #62 from dtantsur/split
Jul 8, 2019
f8bd2e1
Repair logging of ironic-services to /shared/log
dtantsur Jul 8, 2019
5455c76
Start using ironic-prometheus-exporter package
iurygregory Jun 14, 2019
c9b470a
Merge pull request #63 from dtantsur/master
dtantsur Jul 8, 2019
9aedd84
Merge pull request #57 from iurygregory/exporter_package
dtantsur Jul 8, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 14 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ FROM docker.io/centos:centos7
# TODO(iurygregory): remove epel-release and other packages necessary for the ironic_prometheus_exporter when we have a package for it
RUN yum install -y python-requests && \
curl https://raw.githubusercontent.com/openstack/tripleo-repos/master/tripleo_repos/main.py | python - current-tripleo && \
yum install -y epel-release python-pip python-devel gcc openstack-ironic-api openstack-ironic-conductor crudini iproute dnsmasq httpd qemu-img-ev iscsi-initiator-utils parted gdisk ipxe-bootimgs psmisc sysvinit-tools mariadb-server python-PyMySQL python2-chardet && \
yum update -y && \
yum install -y epel-release python-pip python-devel gcc openstack-ironic-api openstack-ironic-conductor crudini \
iproute iptables dnsmasq httpd qemu-img-ev iscsi-initiator-utils parted gdisk ipxe-bootimgs psmisc sysvinit-tools \
mariadb-server python-PyMySQL python2-chardet && \
yum install -y python-configparser python2-prometheus_client && \
yum clean all

Expand All @@ -12,12 +15,20 @@ RUN mkdir /tftpboot && \

COPY ./installexporter.sh /bin/installexporter
RUN /bin/installexporter
COPY ./runironic.sh /bin/runironic
COPY ./runironic-api.sh /bin/runironic-api
COPY ./runironic-conductor.sh /bin/runironic-conductor
COPY ./runironic-exporter.sh /bin/runironic-exporter
COPY ./rundnsmasq.sh /bin/rundnsmasq
COPY ./runhttpd.sh /bin/runhttpd
COPY ./runmariadb.sh /bin/runmariadb
COPY ./runhealthcheck.sh /bin/runhealthcheck
COPY ./configure-ironic.sh /bin/configure-ironic.sh

# TODO(dtantsur): remove these 3 scripts and squash runexporterapp into
# runironic-exporter if we decide to stop supporting running all 3 processes
# via one entry point.
COPY ./runexporterapp.sh /bin/runexporterapp
COPY ./runhealthcheck.sh /bin/runhealthcheck
COPY ./runironic.sh /bin/runironic

COPY ./dnsmasq.conf /etc/dnsmasq.conf
COPY ./inspector.ipxe /tmp/inspector.ipxe
Expand Down
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@ All of the containers must share a common mount point or data store. Ironic req
All of the containers also store log files to <shared store>/log/.

The following environment variables can be passed in to customize run-time functionality:
- IP - provisioning interface IP address (default 172.22.0.1)
- INTERFACE - interface to use for provisioning (default provisioning)
- EXCEPT_INTERFACE - interfaces to exclude when providing DHCP address (default "lo")
- PROVISIONING_INTERFACE - interface to use for ironic, dnsmasq(dhcpd) and httpd (default provisioning)
- DNSMASQ_EXCEPT_INTERFACE - interfaces to exclude when providing DHCP address (default "lo")
- HTTP_PORT - port used by http server (default 80)
- DHCP_RANGE - dhcp range to use for provisioning (default 172.22.0.10-172.22.0.100)
- MARIADB_PASSWORD - The database password
55 changes: 55 additions & 0 deletions configure-ironic.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#!/usr/bin/bash

# Get environment settings and update ironic.conf
PROVISIONING_INTERFACE=${PROVISIONING_INTERFACE:-"provisioning"}
IRONIC_IP=$(ip -4 address show dev "$PROVISIONING_INTERFACE" | grep -oP '(?<=inet\s)\d+(\.\d+){3}' | head -n 1)
HTTP_PORT=${HTTP_PORT:-"80"}
MARIADB_PASSWORD=${MARIADB_PASSWORD:-"change_me"}
NUMPROC=$(cat /proc/cpuinfo | grep "^processor" | wc -l)
NUMWORKERS=$(( NUMPROC < 12 ? NUMPROC : 12 ))

cp /etc/ironic/ironic.conf /etc/ironic/ironic.conf_orig

crudini --set /etc/ironic/ironic.conf DEFAULT auth_strategy noauth
crudini --set /etc/ironic/ironic.conf DEFAULT my_ip "$IRONIC_IP"
crudini --set /etc/ironic/ironic.conf DEFAULT debug true
crudini --set /etc/ironic/ironic.conf DEFAULT default_network_interface noop
crudini --set /etc/ironic/ironic.conf DEFAULT enabled_boot_interfaces pxe,ipxe,fake
crudini --set /etc/ironic/ironic.conf DEFAULT enabled_power_interfaces ipmitool,idrac,fake
crudini --set /etc/ironic/ironic.conf DEFAULT enabled_management_interfaces ipmitool,idrac,fake
crudini --set /etc/ironic/ironic.conf DEFAULT enabled_hardware_types ipmi,idrac,fake-hardware
crudini --set /etc/ironic/ironic.conf DEFAULT enabled_vendor_interfaces ipmitool,no-vendor,idrac,fake
crudini --set /etc/ironic/ironic.conf DEFAULT enabled_deploy_interfaces direct,fake
crudini --set /etc/ironic/ironic.conf DEFAULT default_boot_interface ipxe
crudini --set /etc/ironic/ironic.conf DEFAULT default_deploy_interface direct
crudini --set /etc/ironic/ironic.conf DEFAULT enabled_inspect_interfaces inspector,idrac,fake
crudini --set /etc/ironic/ironic.conf DEFAULT default_inspect_interface inspector
crudini --set /etc/ironic/ironic.conf DEFAULT rpc_transport json-rpc
crudini --set /etc/ironic/ironic.conf conductor enable_mdns True
crudini --set /etc/ironic/ironic.conf conductor send_sensor_data true
crudini --set /etc/ironic/ironic.conf oslo_messaging_notifications driver prometheus_exporter
crudini --set /etc/ironic/ironic.conf oslo_messaging_notifications transport_url fake://
crudini --set /etc/ironic/ironic.conf oslo_messaging_notifications location /shared/ironic_prometheus_exporter
crudini --set /etc/ironic/ironic.conf dhcp dhcp_provider none
crudini --set /etc/ironic/ironic.conf conductor automated_clean true
crudini --set /etc/ironic/ironic.conf conductor api_url http://${IRONIC_IP}:6385
crudini --set /etc/ironic/ironic.conf database connection mysql+pymysql://ironic:${MARIADB_PASSWORD}@localhost/ironic?charset=utf8
crudini --set /etc/ironic/ironic.conf deploy http_url http://${IRONIC_IP}:${HTTP_PORT}
crudini --set /etc/ironic/ironic.conf deploy http_root /shared/html/
crudini --set /etc/ironic/ironic.conf deploy default_boot_option local
crudini --set /etc/ironic/ironic.conf deploy erase_devices_priority 0
crudini --set /etc/ironic/ironic.conf deploy erase_devices_metadata_priority 10
crudini --set /etc/ironic/ironic.conf inspector endpoint_override http://${IRONIC_IP}:5050
crudini --set /etc/ironic/ironic.conf pxe ipxe_enabled true
crudini --set /etc/ironic/ironic.conf pxe tftp_root /shared/tftpboot
crudini --set /etc/ironic/ironic.conf pxe tftp_master_path /shared/tftpboot
crudini --set /etc/ironic/ironic.conf pxe instance_master_path /shared/html/master_images
crudini --set /etc/ironic/ironic.conf pxe images_path /shared/html/tmp
crudini --set /etc/ironic/ironic.conf pxe pxe_config_template \$pybasedir/drivers/modules/ipxe_config.template
crudini --set /etc/ironic/ironic.conf pxe uefi_pxe_config_template \$pybasedir/drivers/modules/ipxe_config.template
crudini --set /etc/ironic/ironic.conf agent deploy_logs_collect always
crudini --set /etc/ironic/ironic.conf agent deploy_logs_local_path /shared/log/ironic/deploy
crudini --set /etc/ironic/ironic.conf api api_workers "$NUMWORKERS"

mkdir -p /shared/html
mkdir -p /shared/ironic_prometheus_exporter
2 changes: 1 addition & 1 deletion dnsmasq.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
interface=INTERFACE
interface=PROVISIONING_INTERFACE
bind-dynamic
dhcp-range=DHCP_RANGE
enable-tftp
Expand Down
3 changes: 2 additions & 1 deletion inspector.ipxe
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
:retry_boot
echo In inspector.ipxe
imgfree
kernel --timeout 60000 http://IRONIC_IP:HTTP_PORT/images/ironic-python-agent.kernel ipa-inspection-callback-url=http://IRONIC_IP:5050/v1/continue ipa-inspection-collectors=default,extra-hardware,logs systemd.journald.forward_to_console=yes BOOTIF=${mac} ipa-debug=1 ipa-inspection-dhcp-all-interfaces=1 ipa-collect-lldp=1 initrd=ironic-python-agent.initramfs || goto retry_boot
# NOTE(dtantsur): keep inspection kernel params in [mdns]params in ironic-inspector-image
kernel --timeout 60000 http://IRONIC_IP:HTTP_PORT/images/ironic-python-agent.kernel ipa-inspection-callback-url=mdns systemd.journald.forward_to_console=yes BOOTIF=${mac} ipa-debug=1 initrd=ironic-python-agent.initramfs || goto retry_boot
initrd --timeout 60000 http://IRONIC_IP:HTTP_PORT/images/ironic-python-agent.initramfs || goto retry_boot
boot
23 changes: 14 additions & 9 deletions rundnsmasq.sh
Original file line number Diff line number Diff line change
@@ -1,28 +1,33 @@
#!/usr/bin/bash

IP=${IP:-"172.22.0.1"}
PROVISIONING_INTERFACE=${PROVISIONING_INTERFACE:-"provisioning"}

HTTP_PORT=${HTTP_PORT:-"80"}
DHCP_RANGE=${DHCP_RANGE:-"172.22.0.10,172.22.0.100"}
INTERFACE=${INTERFACE:-"provisioning"}
EXCEPT_INTERFACE=${EXCEPT_INTERFACE:-"lo"}
DNSMASQ_EXCEPT_INTERFACE=${DNSMASQ_EXCEPT_INTERFACE:-"lo"}

PROVISIONING_IP=$(ip -4 address show dev "$PROVISIONING_INTERFACE" | grep -oP '(?<=inet\s)\d+(\.\d+){3}' | head -n 1)

mkdir -p /shared/tftpboot
mkdir -p /shared/html/images
mkdir -p /shared/html/pxelinux.cfg
mkdir -p /shared/log/dnsmasq

# Copy files to shared mount
cp /usr/share/ipxe/undionly.kpxe /usr/share/ipxe/ipxe.efi /shared/tftpboot

# Use configured values
sed -i -e s/IRONIC_IP/$IP/g -e s/HTTP_PORT/$HTTP_PORT/g \
-e s/DHCP_RANGE/$DHCP_RANGE/g -e s/INTERFACE/$INTERFACE/g /etc/dnsmasq.conf
for iface in $( echo $EXCEPT_INTERFACE | tr ',' ' '); do
sed -i -e "/^interface=.*/ a\except-interface=$iface" /etc/dnsmasq.conf
sed -i -e s/IRONIC_IP/${PROVISIONING_IP}/g -e s/HTTP_PORT/${HTTP_PORT}/g \
-e s/DHCP_RANGE/${DHCP_RANGE}/g -e s/PROVISIONING_INTERFACE/${PROVISIONING_INTERFACE}/g \
/etc/dnsmasq.conf
for iface in $( echo "$DNSMASQ_EXCEPT_INTERFACE" | tr ',' ' '); do
sed -i -e "/^interface=.*/ a\except-interface=${iface}" /etc/dnsmasq.conf
done

# Allow access to dhcp and tftp server for pxeboot
for port in 67 69 ; do
if ! iptables -C INPUT -i $INTERFACE -p udp --dport $port -j ACCEPT 2>/dev/null ; then
iptables -I INPUT -i $INTERFACE -p udp --dport $port -j ACCEPT
if ! iptables -C INPUT -i "$PROVISIONING_INTERFACE" -p udp --dport "$port" -j ACCEPT 2>/dev/null ; then
iptables -I INPUT -i "$PROVISIONING_INTERFACE" -p udp --dport "$port" -j ACCEPT
fi
done

Expand Down
13 changes: 7 additions & 6 deletions runhttpd.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/usr/bin/bash

IP=${IP:-"172.22.0.1"}
PROVISIONING_INTERFACE=${PROVISIONING_INTERFACE:-"provisioning"}
HTTP_PORT=${HTTP_PORT:-"80"}
HTTP_IP=$(ip -4 address show dev "$PROVISIONING_INTERFACE" | grep -oP '(?<=inet\s)\d+(\.\d+){3}' | head -n 1)

mkdir -p /shared/html
chmod 0777 /shared/html
Expand All @@ -11,7 +12,7 @@ cp /tmp/inspector.ipxe /shared/html/inspector.ipxe
cp /tmp/dualboot.ipxe /shared/html/dualboot.ipxe

# Use configured values
sed -i -e s/IRONIC_IP/$IP/g -e s/HTTP_PORT/$HTTP_PORT/g /shared/html/inspector.ipxe
sed -i -e s/IRONIC_IP/${HTTP_IP}/g -e s/HTTP_PORT/${HTTP_PORT}/g /shared/html/inspector.ipxe

sed -i 's/^Listen .*$/Listen '"$HTTP_PORT"'/' /etc/httpd/conf/httpd.conf
sed -i -e 's|\(^[[:space:]]*\)\(DocumentRoot\)\(.*\)|\1\2 "/shared/html"|' \
Expand All @@ -20,7 +21,7 @@ sed -i -e 's|\(^[[:space:]]*\)\(DocumentRoot\)\(.*\)|\1\2 "/shared/html"|' \

# Remove log files from last deployment
rm -rf /shared/log/httpd

mkdir -p /shared/log/httpd

# Make logs available in shared mount
Expand All @@ -30,12 +31,12 @@ touch /shared/log/httpd/error_log
ln -s /shared/log/httpd/error_log /var/log/httpd/error_log

# Allow external access
if ! iptables -C INPUT -p tcp --dport $HTTP_PORT -j ACCEPT 2>/dev/null ; then
iptables -I INPUT -p tcp --dport $HTTP_PORT -j ACCEPT
if ! iptables -C INPUT -i "$PROVISIONING_INTERFACE" -p tcp --dport "$HTTP_PORT" -j ACCEPT 2>/dev/null ; then
iptables -I INPUT -i "$PROVISIONING_INTERFACE" -p tcp --dport "$HTTP_PORT" -j ACCEPT
fi

/usr/sbin/httpd &

/bin/runhealthcheck "httpd" $HTTP_PORT &>/dev/null &
/bin/runhealthcheck "httpd" "$HTTP_PORT" &>/dev/null &
sleep infinity

12 changes: 12 additions & 0 deletions runironic-api.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/bash

. /bin/configure-ironic.sh

# Allow access to Ironic
if ! iptables -C INPUT -i "$PROVISIONING_INTERFACE" -p tcp -m tcp --dport 6385 -j ACCEPT > /dev/null 2>&1; then
iptables -I INPUT -i "$PROVISIONING_INTERFACE" -p tcp -m tcp --dport 6385 -j ACCEPT
fi

ironic-dbsync --config-file /etc/ironic/ironic.conf upgrade

exec /usr/bin/ironic-api --config-file /etc/ironic/ironic.conf
18 changes: 18 additions & 0 deletions runironic-conductor.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/bash

. /bin/configure-ironic.sh

# Allow access to mDNS
if ! iptables -C INPUT -i $PROVISIONING_INTERFACE -p udp --dport 5353 -j ACCEPT > /dev/null 2>&1; then
iptables -I INPUT -i $PROVISIONING_INTERFACE -p udp --dport 5353 -j ACCEPT
fi
if ! iptables -C OUTPUT -p udp --dport 5353 -j ACCEPT > /dev/null 2>&1; then
iptables -I OUTPUT -p udp --dport 5353 -j ACCEPT
fi

# Ramdisk logs
mkdir -p /shared/log/ironic/deploy

ironic-dbsync --config-file /etc/ironic/ironic.conf upgrade

exec /usr/bin/ironic-conductor --config-file /etc/ironic/ironic.conf
7 changes: 7 additions & 0 deletions runironic-exporter.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/bash

. /bin/configure-ironic.sh

# TODO(dtantsur): merge these two scripts when/if we no longer support
# all-in-one container
/bin/runexporterapp
67 changes: 12 additions & 55 deletions runironic.sh
Original file line number Diff line number Diff line change
@@ -1,72 +1,29 @@
#!/usr/bin/bash

# Get environment settings and update ironic.conf
IP=${IP:-"172.22.0.1"}
HTTP_PORT=${HTTP_PORT:-"80"}
INTERFACE=${INTERFACE:-"provisioning"}
MARIADB_PASSWORD=${MARIADB_PASSWORD:-"change_me"}
NUMPROC=$(cat /proc/cpuinfo | grep "^processor" | wc -l)
NUMWORKERS=$(( NUMPROC < 12 ? NUMPROC : 12 ))

. /bin/configure-ironic.sh

# Allow access to Ironic
if ! iptables -C INPUT -i $INTERFACE -p tcp -m tcp --dport 6385 -j ACCEPT > /dev/null 2>&1; then
iptables -I INPUT -i $INTERFACE -p tcp -m tcp --dport 6385 -j ACCEPT
if ! iptables -C INPUT -i "$PROVISIONING_INTERFACE" -p tcp -m tcp --dport 6385 -j ACCEPT > /dev/null 2>&1; then
iptables -I INPUT -i "$PROVISIONING_INTERFACE" -p tcp -m tcp --dport 6385 -j ACCEPT
fi

cp /etc/ironic/ironic.conf /etc/ironic/ironic.conf_orig

crudini --set /etc/ironic/ironic.conf DEFAULT auth_strategy noauth
crudini --set /etc/ironic/ironic.conf DEFAULT my_ip ${IP}
crudini --set /etc/ironic/ironic.conf DEFAULT debug true
crudini --set /etc/ironic/ironic.conf DEFAULT default_network_interface noop
crudini --set /etc/ironic/ironic.conf DEFAULT enabled_boot_interfaces pxe,ipxe,fake
crudini --set /etc/ironic/ironic.conf DEFAULT enabled_power_interfaces ipmitool,idrac,fake
crudini --set /etc/ironic/ironic.conf DEFAULT enabled_management_interfaces ipmitool,idrac,fake
crudini --set /etc/ironic/ironic.conf DEFAULT enabled_hardware_types ipmi,idrac,fake-hardware
crudini --set /etc/ironic/ironic.conf DEFAULT enabled_vendor_interfaces ipmitool,no-vendor,idrac,fake
crudini --set /etc/ironic/ironic.conf DEFAULT enabled_deploy_interfaces direct,fake
crudini --set /etc/ironic/ironic.conf DEFAULT default_boot_interface ipxe
crudini --set /etc/ironic/ironic.conf DEFAULT default_deploy_interface direct
crudini --set /etc/ironic/ironic.conf DEFAULT enabled_inspect_interfaces inspector,idrac,fake
crudini --set /etc/ironic/ironic.conf DEFAULT default_inspect_interface inspector
crudini --set /etc/ironic/ironic.conf DEFAULT rpc_transport json-rpc
crudini --set /etc/ironic/ironic.conf conductor send_sensor_data true
crudini --set /etc/ironic/ironic.conf oslo_messaging_notifications driver prometheus_exporter
crudini --set /etc/ironic/ironic.conf oslo_messaging_notifications transport_url fake://
crudini --set /etc/ironic/ironic.conf oslo_messaging_notifications location /tmp/ironic_prometheus_exporter
crudini --set /etc/ironic/ironic.conf dhcp dhcp_provider none
crudini --set /etc/ironic/ironic.conf conductor automated_clean true
crudini --set /etc/ironic/ironic.conf conductor api_url http://${IP}:6385
crudini --set /etc/ironic/ironic.conf database connection mysql+pymysql://ironic:${MARIADB_PASSWORD}@localhost/ironic?charset=utf8
crudini --set /etc/ironic/ironic.conf deploy http_url http://${IP}:${HTTP_PORT}
crudini --set /etc/ironic/ironic.conf deploy http_root /shared/html/
crudini --set /etc/ironic/ironic.conf deploy default_boot_option local
crudini --set /etc/ironic/ironic.conf deploy erase_devices_priority 0
crudini --set /etc/ironic/ironic.conf deploy erase_devices_metadata_priority 10
crudini --set /etc/ironic/ironic.conf inspector endpoint_override http://${IP}:5050
crudini --set /etc/ironic/ironic.conf pxe ipxe_enabled true
crudini --set /etc/ironic/ironic.conf pxe tftp_root /shared/tftpboot
crudini --set /etc/ironic/ironic.conf pxe tftp_master_path /shared/tftpboot
crudini --set /etc/ironic/ironic.conf pxe instance_master_path /shared/html/master_images
crudini --set /etc/ironic/ironic.conf pxe images_path /shared/html/tmp
crudini --set /etc/ironic/ironic.conf pxe pxe_config_template \$pybasedir/drivers/modules/ipxe_config.template
crudini --set /etc/ironic/ironic.conf pxe uefi_pxe_config_template \$pybasedir/drivers/modules/ipxe_config.template
crudini --set /etc/ironic/ironic.conf agent deploy_logs_collect always
crudini --set /etc/ironic/ironic.conf agent deploy_logs_local_path /shared/log/ironic/deploy
crudini --set /etc/ironic/ironic.conf api api_workers ${NUMWORKERS}
# Allow access to mDNS
if ! iptables -C INPUT -i $PROVISIONING_INTERFACE -p udp --dport 5353 -j ACCEPT > /dev/null 2>&1; then
iptables -I INPUT -i $PROVISIONING_INTERFACE -p udp --dport 5353 -j ACCEPT
fi
if ! iptables -C OUTPUT -p udp --dport 5353 -j ACCEPT > /dev/null 2>&1; then
iptables -I OUTPUT -p udp --dport 5353 -j ACCEPT
fi

ironic-dbsync --config-file /etc/ironic/ironic.conf upgrade

mkdir -p /shared/html

# Remove log files from last deployment
rm -rf /shared/log/ironic

mkdir -p /shared/log/ironic

/usr/bin/python2 /usr/bin/ironic-conductor --log-file /shared/log/ironic/ironic-conductor.log &
/usr/bin/python2 /usr/bin/ironic-api --log-file /shared/log/ironic/ironic-api.log &
/usr/bin/ironic-conductor --log-file /shared/log/ironic/ironic-conductor.log &
/usr/bin/ironic-api --log-file /shared/log/ironic/ironic-api.log &

/bin/runhealthcheck "ironic" &>/dev/null &
/bin/runexporterapp &
Expand Down
2 changes: 1 addition & 1 deletion runmariadb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ if [ ! -d "${DATADIR}/mysql" ]; then
chown -R mysql /shared/log/mariadb

sed -i 's/var\/log\/mariadb\/mariadb\.log/shared\/log\/mariadb\/mariadb\.log/g' \
/etc/my.cnf.d/mariadb-server.cnf
/etc/my.cnf.d/mariadb-server.cnf

chown -R mysql "$DATADIR"

Expand Down