diskimage-builder/elements/nova/install.d/74-nova
Tim Miller 0809886571 Add a nova-baremetal element.
Future work is intended to allow this to serve
as a nova-virt element as well, by allowing the config
and which services are run (such as bm-deploy-helper)
based upon metadata config settings.

Change-Id: I59718a0b329e6adc59097492638cf02c76162c0a
2013-04-03 10:45:28 -07:00

56 lines
1.9 KiB
Bash
Executable File

#!/bin/bash
set -eux
function install_dnsmasq_upstart {
cat > /etc/init/nova-bm-dnsmasq.conf << eof
start on runlevel [2345]
stop on runlevel [016]
pre-start script
mkdir -p /tftpboot
chown -R nova:nova /tftpboot
killall -9 dnsmasq || echo 'no dnsmasq running'
end script
task
script
exec dnsmasq --conf-file= \\
--port=0 \\
--enable-tftp \\
--tftp-root=/tftpboot \\
--dhcp-boot=pxelinux.0 \\
--bind-interfaces \\
--pid-file=/var/run/dnsmasq.pid \\
--interface=eth0 \\
--dhcp-range=10.8.53.201,10.8.53.206,29
end script
eof
}
install-packages dnsmasq novnc dnsmasq-utils ebtables
os-svc-install -n nova -u nova -r https://github.com/openstack/nova.git
# for libvirt clouds only
install-packages libvirt-bin python-libvirt kvm pm-utils syslinux
usermod -a -G libvirtd nova
mkdir -p /var/run/nova/keys && chown -R nova:nova /var/run/nova/keys
os-svc-daemon nova-api nova nova-api "--config-dir /etc/nova"
os-svc-daemon nova-rpc-zmq-receiver nova nova-rpc-zmq-receiver "--config-dir /etc/nova"
os-svc-daemon nova-cert nova nova-cert "--config-dir /etc/nova"
os-svc-daemon nova-scheduler nova nova-scheduler "--config-dir /etc/nova --debug"
os-svc-daemon nova-consoleauth nova nova-consoleauth "--config-dir /etc/nova"
os-svc-daemon nova-conductor nova nova-conductor "--config-dir /etc/nova"
os-svc-daemon nova-compute nova nova-compute "--config-dir /etc/nova"
os-svc-daemon nova-baremetal-deploy-helper \
nova nova-baremetal-deploy-helper "--config-dir /etc/nova"
install_dnsmasq_upstart
mkdir -p /tftpboot/pxelinux.cfg/
cp /usr/lib/syslinux/pxelinux.0 /tftpboot/
chown -R nova:nova /var/lib/misc/
echo "nova ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/nova
chmod 0440 /etc/sudoers.d/nova
visudo -c