diff --git a/lib/heat b/lib/heat index 902333e29a..7a2d764923 100644 --- a/lib/heat +++ b/lib/heat @@ -38,6 +38,9 @@ HEAT_CONF=$HEAT_CONF_DIR/heat.conf HEAT_ENV_DIR=$HEAT_CONF_DIR/environment.d HEAT_TEMPLATES_DIR=$HEAT_CONF_DIR/templates +# other default options +HEAT_DEFERRED_AUTH=${HEAT_DEFERRED_AUTH:-trusts} + # Tell Tempest this project is present TEMPEST_SERVICES+=,heat @@ -247,18 +250,21 @@ function create_heat_accounts { # heat_stack_user role is for users created by Heat openstack role create heat_stack_user - # heat_stack_owner role is given to users who create Heat stacks, - # it's the default role used by heat to delegate to the heat service - # user (for performing deferred operations via trusts), see heat.conf - HEAT_OWNER_ROLE=$(openstack role create \ - heat_stack_owner \ - | grep " id " | get_field 2) + if [[ $HEAT_DEFERRED_AUTH == trusts ]]; then + # heat_stack_owner role is given to users who create Heat stacks, + # it's the default role used by heat to delegate to the heat service + # user (for performing deferred operations via trusts), see heat.conf + HEAT_OWNER_ROLE=$(openstack role create \ + heat_stack_owner \ + | grep " id " | get_field 2) - # Give the role to the demo and admin users so they can create stacks - # in either of the projects created by devstack - openstack role add $HEAT_OWNER_ROLE --project demo --user demo - openstack role add $HEAT_OWNER_ROLE --project demo --user admin - openstack role add $HEAT_OWNER_ROLE --project admin --user admin + # Give the role to the demo and admin users so they can create stacks + # in either of the projects created by devstack + openstack role add $HEAT_OWNER_ROLE --project demo --user demo + openstack role add $HEAT_OWNER_ROLE --project demo --user admin + openstack role add $HEAT_OWNER_ROLE --project admin --user admin + iniset $HEAT_CONF DEFAULT deferred_auth_method trusts + fi # Note we have to pass token/endpoint here because the current endpoint and # version negotiation in OSC means just --os-identity-api-version=3 won't work