#!/bin/bash
set -eux

# Used by all compute
install-packages dnsmasq dnsmasq-utils ebtables qemu-utils syslinux

os-svc-daemon nova-compute  nova nova-compute          "--config-dir /etc/nova"

chown -R nova:nova /var/lib/misc/

# Use the rootwrap config from the source repo.
install -o root -g root -m 0755 -d /etc/nova/rootwrap.d
for f in $(ls /opt/stack/nova/etc/nova/rootwrap.d/); do
  install -o root -g root -m 644 /opt/stack/nova/etc/nova/rootwrap.d/$f /etc/nova/rootwrap.d/$f
done
install -o root -g root -m 0644 /opt/stack/nova/etc/nova/rootwrap.conf /etc/nova/rootwrap.conf
