dd7648277f
Where the base install for the image uses systemd but the iptables service is not present, the postinstall script for the ironic-agent element can fail. This is due to 'systemctl disable iptables.service' returning an error status when the service isn't present. Check whether the service is enabled using 'systemctl list-unit-files'. Change-Id: I8069b062a27caead4097747d7aeae24a5262e117
33 lines
697 B
Bash
Executable File
33 lines
697 B
Bash
Executable File
#!/bin/bash
|
|
|
|
if [ "${DIB_DEBUG_TRACE:-0}" -gt 0 ]; then
|
|
set -x
|
|
fi
|
|
set -eu
|
|
set -o pipefail
|
|
|
|
install-packages -e git cloud-init
|
|
|
|
rm -rf /tmp/ironic-python-agent
|
|
|
|
case "$DIB_INIT_SYSTEM" in
|
|
upstart)
|
|
if [ -f /etc/init/ufw.conf ]; then
|
|
mv /etc/init/ufw.conf /etc/init/ufw.conf.disabled
|
|
fi
|
|
;;
|
|
systemd)
|
|
if [[ $(systemctl --no-pager list-unit-files iptables) =~ 'enabled' ]]; then
|
|
systemctl disable iptables.service
|
|
fi
|
|
systemctl enable $(svc-map ironic-python-agent).service
|
|
;;
|
|
sysv)
|
|
update-rc.d iptables disable
|
|
;;
|
|
*)
|
|
echo "Unsupported init system"
|
|
exit 1
|
|
;;
|
|
esac
|