2014-06-27 11:54:29 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2014-09-04 04:56:29 +00:00
|
|
|
if [ "${DIB_DEBUG_TRACE:-0}" -gt 0 ]; then
|
|
|
|
set -x
|
|
|
|
fi
|
2014-06-27 11:54:29 +00:00
|
|
|
set -eu
|
|
|
|
set -o pipefail
|
|
|
|
|
2019-02-15 10:01:35 +00:00
|
|
|
install-packages -e cloud-init
|
2015-08-11 11:11:28 +00:00
|
|
|
|
2014-06-27 11:54:29 +00:00
|
|
|
rm -rf /tmp/ironic-python-agent
|
|
|
|
|
2015-07-06 15:14:54 +00:00
|
|
|
case "$DIB_INIT_SYSTEM" in
|
|
|
|
upstart)
|
|
|
|
if [ -f /etc/init/ufw.conf ]; then
|
|
|
|
mv /etc/init/ufw.conf /etc/init/ufw.conf.disabled
|
|
|
|
fi
|
2016-03-25 14:45:53 +00:00
|
|
|
if [ -f /etc/init/tgt.conf ]; then
|
|
|
|
mv /etc/init/tgt.conf /etc/init/tgt.conf.disabled
|
|
|
|
fi
|
2015-07-06 15:14:54 +00:00
|
|
|
;;
|
|
|
|
systemd)
|
2016-03-22 00:59:26 +00:00
|
|
|
if [[ $(systemctl --no-pager list-unit-files iptables) =~ 'enabled' ]]; then
|
|
|
|
systemctl disable iptables.service
|
|
|
|
fi
|
2015-08-31 14:27:44 +00:00
|
|
|
systemctl enable $(svc-map ironic-python-agent).service
|
2017-09-22 09:13:22 +00:00
|
|
|
systemctl enable ironic-agent-create-rescue-user.path
|
2015-07-06 15:14:54 +00:00
|
|
|
;;
|
|
|
|
sysv)
|
|
|
|
update-rc.d iptables disable
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "Unsupported init system"
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|