#!/bin/bash
# In order for CFME to access the Swift objects with hardware data about
# the Ironic nodes, we need to give the admin user the swiftoperator role
# on the service tenant.

set -eux

source /root/stackrc

# We need to make sure the role is not already added
if ! openstack role list --user admin --project service | grep swiftoperator; then
    openstack role add --user admin --project service swiftoperator
fi
