From 0170665c672eaf8607bb5fd4f1159624d48b3585 Mon Sep 17 00:00:00 2001 From: Ethan Lynn Date: Mon, 3 Aug 2015 16:36:42 +0800 Subject: [PATCH] Make auth_uri attribute for ec2authtoken section Make auth_uri attribute for ec2authtoken section Closes-Bug: #1480818 Change-Id: I6b3018317e6c4890d193aee6f6b5e101d901e687 --- attributes/default.rb | 1 + recipes/common.rb | 2 ++ spec/spec_helper.rb | 6 ++++++ templates/default/heat.conf.erb | 2 +- 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/attributes/default.rb b/attributes/default.rb index 4a40654..bdefa69 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -50,6 +50,7 @@ default['openstack']['orchestration']['service_tenant_name'] = 'service' default['openstack']['orchestration']['service_user'] = 'heat' default['openstack']['orchestration']['service_role'] = 'service' +default['openstack']['orchestration']['ec2authtoken']['auth']['version'] = 'v2.0' default['openstack']['orchestration']['api']['auth']['version'] = node['openstack']['api']['auth']['version'] # A PEM encoded Certificate Authority to use for clients when verifying HTTPs connections. diff --git a/recipes/common.rb b/recipes/common.rb index a5143f0..64188f9 100644 --- a/recipes/common.rb +++ b/recipes/common.rb @@ -70,6 +70,7 @@ if node['openstack']['orchestration']['stack_domain_admin'] stack_domain_admin_password = get_password 'user', node['openstack']['orchestration']['stack_domain_admin'] end +ec2_auth_uri = auth_uri_transform identity_endpoint.to_s, node['openstack']['orchestration']['ec2authtoken']['auth']['version'] auth_uri = auth_uri_transform identity_endpoint.to_s, node['openstack']['orchestration']['api']['auth']['version'] identity_uri = identity_uri_transform(identity_admin_endpoint) @@ -114,6 +115,7 @@ template '/etc/heat/heat.conf' do mq_service_type: mq_service_type, mq_password: mq_password, rabbit_hosts: rabbit_hosts, + ec2_auth_uri: ec2_auth_uri, auth_uri: auth_uri, identity_uri: identity_uri, service_pass: service_pass, diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index a301465..00fda90 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -406,6 +406,12 @@ shared_examples 'expects to create heat conf' do end end + describe 'has ec2authtoken values' do + it 'has default ec2authtoken values' do + expect(chef_run).to render_config_file(file.name).with_section_content('ec2authtoken', %r{^auth_uri=http://127.0.0.1:5000/v2.0$}) + end + end + describe 'has rabbit values' do before do node.set['openstack']['mq']['orchestration']['service_type'] = 'rabbitmq' diff --git a/templates/default/heat.conf.erb b/templates/default/heat.conf.erb index 6cf34bb..c36e905 100644 --- a/templates/default/heat.conf.erb +++ b/templates/default/heat.conf.erb @@ -964,7 +964,7 @@ sql_connection=<%= @sql_connection %> # # Authentication Endpoint URI. (string value) -#auth_uri= +auth_uri=<%= @ec2_auth_uri %> # Allow orchestration of multiple clouds. (boolean value) #multi_cloud=false