diff --git a/attributes/default.rb b/attributes/default.rb index 348c265..b7b8288 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -37,6 +37,10 @@ default['openstack']['block-storage']['custom_template_banner'] = ' default['openstack']['block-storage']['verbose'] = 'False' default['openstack']['block-storage']['debug'] = 'False' +# Name of this node. This can be an opaque identifier. It is +# not necessarily a hostname, FQDN, or IP address. (StrOpt) +default['openstack']['block-storage']['host'] = nil + # Specify policy.json remote file to import default['openstack']['block-storage']['policyfile_url'] = nil diff --git a/spec/cinder_common_spec.rb b/spec/cinder_common_spec.rb index 8ed5454..5ffe9b6 100644 --- a/spec/cinder_common_spec.rb +++ b/spec/cinder_common_spec.rb @@ -167,7 +167,7 @@ describe 'openstack-block-storage::cinder-common' do context 'template contents' do context 'commonly named attributes' do - %w(debug verbose notification_driver + %w(debug verbose host notification_driver storage_availability_zone quota_volumes quota_gigabytes quota_driver volume_name_template snapshot_name_template osapi_volume_workers use_default_quota_class quota_snapshots no_snapshot_gb_quota @@ -175,7 +175,7 @@ describe 'openstack-block-storage::cinder-common' do it "has a #{attr_key} attribute" do node.set['openstack']['block-storage'][attr_key] = "#{attr_key}_value" - expect(chef_run).to render_file(file.name).with_content(/^#{attr_key}=#{attr_key}_value$/) + expect(chef_run).to render_config_file(file.name).with_section_content('DEFAULT', /^#{attr_key}=#{attr_key}_value$/) end end end @@ -196,6 +196,10 @@ describe 'openstack-block-storage::cinder-common' do expect(chef_run).to render_config_file(file.name).with_section_content('oslo_concurrency', %r(^lock_path=/var/lib/cinder/lock$)) end + it 'does not have unique host id by default' do + expect(chef_run).not_to render_config_file(file.name).with_section_content('DEFAULT', /^host=/) + end + context 'netapp driver' do # FIXME(galstrom21): this block needs to check all of the default # netapp_* configuration options diff --git a/templates/default/cinder.conf.erb b/templates/default/cinder.conf.erb index 7c5af29..53f1516 100644 --- a/templates/default/cinder.conf.erb +++ b/templates/default/cinder.conf.erb @@ -139,7 +139,9 @@ api_rate_limit=<%= node["openstack"]["block-storage"]["api"]["ratelimit"] %> # scheduler_manager=cinder.scheduler.manager.SchedulerManager #### (StrOpt) full class name for the Manager for scheduler -# host=cinder +<% if node['openstack']['block-storage']['host'] -%> +host=<%= node['openstack']['block-storage']['host'] %> +<% end -%> #### (StrOpt) Name of this node. This can be an opaque identifier. It is #### not necessarily a hostname, FQDN, or IP address.