#!/bin/bash

if [ "${DIB_DEBUG_TRACE:-0}" -gt 0 ]; then
    set -x
fi
set -eu
set -o pipefail

case "$DISTRO_NAME" in
    ubuntu )
        echo -e 'deb http://mirror.fuel-infra.org/mcp-repos/ocata/xenial ocata main' >> /etc/apt/sources.list
        curl -Ls http://mirror.fuel-infra.org/mcp-repos/ocata/xenial/archive-mcpocata.key | apt-key add -
    ;;
    *)
        echo "Distro $DISTRO_NAME not supported by Octavia. Exiting."
        exit 1
    ;;
esac
