diff --git a/attributes/default.rb b/attributes/default.rb index cb6086a..66c76f1 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -165,6 +165,7 @@ default['openstack']['block-storage']['cron']['minute'] = '00' default['openstack']['block-storage']['cron']['audit_logfile'] = '/var/log/cinder/audit.log' default['openstack']['block-storage']['volume']['state_path'] = '/var/lib/cinder' +default['openstack']['block-storage']['volume']['volumes_dir'] = '/var/lib/cinder/volumes' default['openstack']['block-storage']['volume']['driver'] = 'cinder.volume.drivers.lvm.LVMISCSIDriver' default['openstack']['block-storage']['volume']['volume_group'] = 'cinder-volumes' default['openstack']['block-storage']['volume']['volume_group_size'] = 40 diff --git a/spec/cinder_common_spec.rb b/spec/cinder_common_spec.rb index 8a996ee..396dde4 100644 --- a/spec/cinder_common_spec.rb +++ b/spec/cinder_common_spec.rb @@ -58,6 +58,10 @@ describe "openstack-block-storage::cinder-common" do expect(@chef_run).to render_file(@file.name).with_content("rpc_backend=cinder.openstack.common.rpc.impl_kombu") end + it "has has volumes_dir set" do + expect(@chef_run).to render_file(@file.name).with_content("volumes_dir=/var/lib/cinder/volumes") + end + it "has correct volume.driver set" do expect(@chef_run).to render_file(@file.name).with_content("volume_driver=cinder.volume.drivers.lvm.LVMISCSIDriver") end diff --git a/templates/default/cinder.conf.erb b/templates/default/cinder.conf.erb index 8e6a9b9..9c844fc 100644 --- a/templates/default/cinder.conf.erb +++ b/templates/default/cinder.conf.erb @@ -577,7 +577,7 @@ rbd_secret_uuid=<%= node["openstack"]["block-storage"]["rbd_secret_uuid"] %> iscsi_helper=<%= node["openstack"]["block-storage"]["volume"]["iscsi_helper"] %> #### (StrOpt) iscsi target user-land tool to use -# volumes_dir=$state_path/volumes +volumes_dir=<%= node['openstack']['block-storage']['volume']['volumes_dir'] %> #### (StrOpt) Volume configuration file storage directory diff --git a/templates/default/targets.conf.erb b/templates/default/targets.conf.erb index fedbd7f..5e017f1 100644 --- a/templates/default/targets.conf.erb +++ b/templates/default/targets.conf.erb @@ -1,7 +1,7 @@ <%= node["openstack"]["block-storage"]["custom_template_banner"] %> <% if %w{redhat centos fedora suse}.include?(node["platform"]) %> -include /var/lib/cinder/volumes/* +include <%= node['openstack']['block-storage']['volume']['volumes_dir'] %>/* <% end %> <% if %w{debian ubuntu}.include?(node["platform"]) %> include /etc/tgt/conf.d/*.conf