diff --git a/README.md b/README.md index 4c672841..8bdb6693 100644 --- a/README.md +++ b/README.md @@ -313,7 +313,7 @@ Arrays whose elements will be copied exactly into the respective config files (c EC2 Configuration Attributes ---------------------------- -* `openstack["compute"]["enabled_apis"]` - Which apis have been enabled in nova compute +* `openstack["compute"]["enabled_apis"]` - Which apis have been enabled in nova compute, only for ec2 and osapi_compute. For metadata, include the api-metadata recipe. Notification Attributes ----------------------- diff --git a/attributes/default.rb b/attributes/default.rb index d92bdf13..1470271d 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -548,7 +548,11 @@ default['openstack']['compute']['misc_paste'] = nil # To disable the EC2 API endpoint, simply remove 'ec2,' from the list # of enabled API services. -default['openstack']['compute']['enabled_apis'] = 'ec2,osapi_compute,metadata' +# NOTE: The metadata api service is enabled via including it's recipe +# NOTE: api-metadata. By default the api-metadata recipe is included in +# NOTE: the os-compute-api role which is included in the +# NOTE: os-compute-single-controller role. +default['openstack']['compute']['enabled_apis'] = 'ec2,osapi_compute' # VMware driver default['openstack']['compute']['vmware']['secret_name'] = 'openstack_vmware_secret_name' diff --git a/recipes/compute.rb b/recipes/compute.rb index 1d8fd906..529a1249 100644 --- a/recipes/compute.rb +++ b/recipes/compute.rb @@ -29,7 +29,10 @@ end include_recipe 'openstack-compute::nova-common' if node['openstack']['compute']['enabled_apis'].include?('metadata') - include_recipe 'openstack-compute::api-metadata' + Chef::Log.warn('Attribute enabled_apis contains metadata, this '\ + 'could result in a timing issue starting the service. '\ + 'Please remove this value and include the api-metadata '\ + 'recipe instead') end include_recipe 'openstack-compute::network' diff --git a/spec/compute_spec.rb b/spec/compute_spec.rb index a4d9f88c..444eac9d 100644 --- a/spec/compute_spec.rb +++ b/spec/compute_spec.rb @@ -20,16 +20,11 @@ describe 'openstack-compute::compute' do end end - it 'includes api-metadata recipe' do - expect(chef_run).to include_recipe 'openstack-compute::api-metadata' + it 'does not include the api-metadata recipe' do + expect(chef_run).not_to include_recipe 'openstack-compute::api-metadata' end it 'does not include api-metadata recipe' do - chef_run = ::ChefSpec::SoloRunner.new ::UBUNTU_OPTS - node = chef_run.node - node.set['openstack']['compute']['enabled_apis'] = 'ec2,osapi_compute' - chef_run.converge 'openstack-compute::compute' - expect(chef_run).not_to include_recipe 'openstack-compute::api-metadata' end diff --git a/spec/identity_registration_spec.rb b/spec/identity_registration_spec.rb index f0e882eb..6bb57ac9 100644 --- a/spec/identity_registration_spec.rb +++ b/spec/identity_registration_spec.rb @@ -288,7 +288,7 @@ describe 'openstack-compute::identity_registration' do describe "when 'ec2' is not in the list of enabled_apis" do before do - node.set['openstack']['compute']['enabled_apis'] = 'osapi_compute,metadata' + node.set['openstack']['compute']['enabled_apis'] = 'osapi_compute' end it 'does not register ec2 service' do