Use platform_family instead of platform
As agreed on the mailing list: https://groups.google.com/forum/#!topic/opscode-chef-openstack/HEL3KqBQIUM This will allow the ibm_powerkvm platform to be recognized and will simplify uses of multiple platforms from the same family. Change-Id: Iebf2aad9f3b4649fb5c27d2fc93ee60c67e42737 Partially-Implements: blueprint add-ibm-powerkvm-enablement Implements: blueprint platform-family
This commit is contained in:
@@ -209,8 +209,8 @@ default['openstack']['block-storage']['policy']['default'] = '["rule:admin_or_ow
|
|||||||
default['openstack']['block-storage']['policy']['admin_or_owner'] = '["is_admin:True"], ["project_id:%(project_id)s"]'
|
default['openstack']['block-storage']['policy']['admin_or_owner'] = '["is_admin:True"], ["project_id:%(project_id)s"]'
|
||||||
default['openstack']['block-storage']['policy']['admin_api'] = '["is_admin:True"]'
|
default['openstack']['block-storage']['policy']['admin_api'] = '["is_admin:True"]'
|
||||||
|
|
||||||
case platform
|
case platform_family
|
||||||
when 'fedora', 'redhat', 'centos' # :pragma-foodcritic: ~FC024 - won't fix this
|
when 'fedora', 'rhel' # :pragma-foodcritic: ~FC024 - won't fix this
|
||||||
# operating system user and group names
|
# operating system user and group names
|
||||||
default['openstack']['block-storage']['user'] = 'cinder'
|
default['openstack']['block-storage']['user'] = 'cinder'
|
||||||
default['openstack']['block-storage']['group'] = 'cinder'
|
default['openstack']['block-storage']['group'] = 'cinder'
|
||||||
@@ -255,7 +255,7 @@ when 'suse'
|
|||||||
'cinder_nfs_packages' => ['nfs-utils'],
|
'cinder_nfs_packages' => ['nfs-utils'],
|
||||||
'cinder_emc_packages' => ['python-pywbem']
|
'cinder_emc_packages' => ['python-pywbem']
|
||||||
}
|
}
|
||||||
when 'ubuntu'
|
when 'debian'
|
||||||
# operating system user and group names
|
# operating system user and group names
|
||||||
default['openstack']['block-storage']['user'] = 'cinder'
|
default['openstack']['block-storage']['user'] = 'cinder'
|
||||||
default['openstack']['block-storage']['group'] = 'cinder'
|
default['openstack']['block-storage']['group'] = 'cinder'
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ service 'cinder-scheduler' do
|
|||||||
subscribes :restart, 'template[/etc/cinder/cinder.conf]'
|
subscribes :restart, 'template[/etc/cinder/cinder.conf]'
|
||||||
end
|
end
|
||||||
|
|
||||||
audit_bin_dir = platform?('ubuntu') ? '/usr/bin' : '/usr/local/bin'
|
audit_bin_dir = platform_family?('debian') ? '/usr/bin' : '/usr/local/bin'
|
||||||
audit_log = node['openstack']['block-storage']['cron']['audit_logfile']
|
audit_log = node['openstack']['block-storage']['cron']['audit_logfile']
|
||||||
|
|
||||||
if node['openstack']['telemetry']
|
if node['openstack']['telemetry']
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
# Short-Description: cinder volume group active script
|
# Short-Description: cinder volume group active script
|
||||||
### END INIT INFO
|
### END INIT INFO
|
||||||
|
|
||||||
<% if %w{centos redhat amazon scientific}.include? node.platform %>
|
<% if %w{rhel}.include? node.platform_family %>
|
||||||
. /etc/rc.d/init.d/functions
|
. /etc/rc.d/init.d/functions
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
@@ -23,10 +23,10 @@ start()
|
|||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo -n "Activating cinder volume group ..."
|
echo -n "Activating cinder volume group ..."
|
||||||
vgcreate <%= @volume_name %> $(losetup --show -f <%= @volume_file %>)
|
vgcreate <%= @volume_name %> $(losetup --show -f <%= @volume_file %>)
|
||||||
<% if %w{centos redhat amazon scientific}.include? node.platform %>
|
<% if %w{rhel}.include? node.platform_family %>
|
||||||
success
|
success
|
||||||
echo
|
echo
|
||||||
<% elsif %w{debian ubuntu}.include? node.platform %>
|
<% elsif %w{debian}.include? node.platform_family %>
|
||||||
echo "SUCCESS"
|
echo "SUCCESS"
|
||||||
<% end %>
|
<% end %>
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
<%= node["openstack"]["block-storage"]["custom_template_banner"] %>
|
<%= node["openstack"]["block-storage"]["custom_template_banner"] %>
|
||||||
|
|
||||||
<% if %w{redhat centos fedora suse}.include?(node["platform"]) %>
|
<% if %w{rhel fedora suse}.include?(node["platform_family"]) %>
|
||||||
include <%= node['openstack']['block-storage']['volume']['volumes_dir'] %>/*
|
include <%= node['openstack']['block-storage']['volume']['volumes_dir'] %>/*
|
||||||
<% end %>
|
<% end %>
|
||||||
<% if %w{debian ubuntu}.include?(node["platform"]) %>
|
<% if %w{debian}.include?(node["platform_family"]) %>
|
||||||
include /etc/tgt/conf.d/*.conf
|
include /etc/tgt/conf.d/*.conf
|
||||||
<% end %>
|
<% end %>
|
||||||
default-driver iscsi
|
default-driver iscsi
|
||||||
|
|||||||
Reference in New Issue
Block a user