#!/bin/bash
set -eux

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

# LIBVIRT_DEFAULT_URI needs to be set due to
# https://bugs.launchpad.net/tripleo/+bug/1226310
os-svc-daemon -i "$NOVA_VENV_DIR" -e "LIBVIRT_DEFAULT_URI=qemu:///system" nova-compute  nova nova-compute          "--config-dir /etc/nova"

# 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
