From dc2d594b0535b524486c13ed52128d8efff6d334 Mon Sep 17 00:00:00 2001 From: Roger Luethi Date: Wed, 1 Nov 2017 10:23:24 +0100 Subject: [PATCH] Grant admin role in heat domain to heat_domain_admin This patch grants heat_domain_admin the admin role in the heat domain (rather then in the service project). We use :grant_domain instead of :grant_role, because we are setting a role in a domain, not in a project. Note that for the user to actually exist in the heat domain, a sufficiently recent openstackclient cookbook is required -- otherwise the domain_name attribute is ignored during user creation. Also, we remove the user_name attribute (gets ignored by resource action). Change-Id: I747e2dedbc517cc3deb2675590fb982459c560a0 --- recipes/identity_registration.rb | 3 +-- spec/identity_registration_spec.rb | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/recipes/identity_registration.rb b/recipes/identity_registration.rb index dbff3b6..ce24069 100644 --- a/recipes/identity_registration.rb +++ b/recipes/identity_registration.rb @@ -163,9 +163,8 @@ end openstack_user stack_domain_admin do domain_name heat_domain_name role_name 'admin' - user_name stack_domain_admin connection_params connection_params - action :grant_role + action :grant_domain end openstack_role 'heat_stack_owner' do diff --git a/spec/identity_registration_spec.rb b/spec/identity_registration_spec.rb index 4dc3113..898cf6b 100644 --- a/spec/identity_registration_spec.rb +++ b/spec/identity_registration_spec.rb @@ -117,7 +117,7 @@ describe 'openstack-orchestration::identity_registration' do end it do - expect(chef_run).to grant_role_openstack_user( + expect(chef_run).to grant_domain_openstack_user( stack_domain_admin ).with( domain_name: stack_domain_name,