#!/bin/bash

set -eux

install-packages openstack-keystone

KEYSTONE_USER=keystone
if [ "opensuse" = "$DISTRO_NAME" ]; then
    KEYSTONE_USER=openstack-keystone
fi

# When keystone-manage is run as root during os-refresh-config it will create
# the initial keystone log file root owned, and then the keystone service will
# fail to start. Create the initial keystone owned log file here instead.
touch /var/log/keystone/keystone.log
chown $KEYSTONE_USER: /var/log/keystone/keystone.log
