Dmitry Tantsur 944c8525a3 DIB: rename files and paths to match the element name
Apparently, DIB is sensitive to file names, at least the package-install
feature. Let us make sure we use ironic-python-agent-ramdisk, not ironic-agent.

Change-Id: I929c0652c320734ff82dd257180c4b7bd156c478
2019-09-19 07:47:56 +00:00

40 lines
929 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 cloud-init
rm -rf /tmp/ironic-python-agent
# Make sure rescue works
mkdir -p /etc/ipa-rescue-config
case "$DIB_INIT_SYSTEM" in
upstart)
if [ -f /etc/init/ufw.conf ]; then
mv /etc/init/ufw.conf /etc/init/ufw.conf.disabled
fi
if [ -f /etc/init/tgt.conf ]; then
mv /etc/init/tgt.conf /etc/init/tgt.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
systemctl enable ironic-agent-create-rescue-user.path
;;
sysv)
update-rc.d iptables disable
;;
*)
echo "Unsupported init system"
exit 1
;;
esac