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
|
|
|
|
|
|
|
|
install-packages -e python-dev git cloud-init
|
2015-08-11 11:11:28 +00:00
|
|
|
# dnf removes unused dependencies by default. As we installed cloud-init before
|
|
|
|
# dmidecode, dnf removes dmidecode above as an unused dependency.
|
|
|
|
# TODO(dtantsur): use `dnf mark` from dnf 1.1.1 in install-packages once this
|
|
|
|
# command is widely available.
|
|
|
|
install-packages dmidecode
|
|
|
|
|
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
|
|
|
|
;;
|
|
|
|
systemd)
|
|
|
|
systemctl disable iptables.service
|
2015-07-30 19:58:51 +00:00
|
|
|
systemctl enable openstack-ironic-python-agent.service
|
2015-07-06 15:14:54 +00:00
|
|
|
;;
|
|
|
|
sysv)
|
|
|
|
update-rc.d iptables disable
|
2015-07-30 19:58:51 +00:00
|
|
|
update-rc.d openstack-ironic-python-agent enable
|
2015-07-06 15:14:54 +00:00
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "Unsupported init system"
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|