cookbook-openstack-block-st.../attributes/default.rb

159 lines
6.8 KiB
Ruby

#
# Cookbook:: openstack-block-storage
# Attributes:: default
#
# Copyright:: 2012-2021, DreamHost
# Copyright:: 2012-2021, Rackspace US, Inc.
# Copyright:: 2012-2021, AT&T Services, Inc.
# Copyright:: 2013-2021, Chef Software, Inc.
# Copyright:: 2013-2021, IBM, Corp
# Copyright:: 2020-2021, Oregon State University
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
########################################################################
# Toggles - These can be overridden at the environment level
default['developer_mode'] = false # we want secure passwords by default
########################################################################
# Set to some text value if you want templated config files
# to contain a custom banner at the top of the written file
default['openstack']['block-storage']['custom_template_banner'] = '
# This file is automatically generated by Chef
# Any changes will be overwritten
'
# Specify policy.json remote file to import
default['openstack']['block-storage']['policyfile_url'] = nil
# Availability zone/region for the OpenStack Block-Storage service
default['openstack']['block-storage']['region'] = node['openstack']['region']
default['openstack']['block-storage']['scheduler_role'] = 'os-block-storage-scheduler'
# The name of the Chef role that knows about the message queue server
# that Cinder uses
default['openstack']['block-storage']['rabbit_server_chef_role'] = 'os-ops-messaging'
# This is the name of the Chef role that will install the Keystone Service API
default['openstack']['block-storage']['keystone_service_chef_role'] = 'keystone'
default['openstack']['block-storage']['service_user'] = 'cinder'
default['openstack']['block-storage']['project'] = 'service'
default['openstack']['block-storage']['service_role'] = 'service'
default['openstack']['block-storage']['service_name'] = 'cinderv2'
default['openstack']['block-storage']['service_type'] = 'volumev2'
# logging attribute
default['openstack']['block-storage']['syslog']['use'] = false
default['openstack']['block-storage']['syslog']['facility'] = 'LOG_LOCAL2'
default['openstack']['block-storage']['syslog']['config_facility'] = 'local2'
default['openstack']['block-storage']['volume']['volume_group_size'] = 40
# Type of volume group to create:
# - 'file' for basic 40g file for testing
# - 'block_devices' for using block devices, specified in block_devices attribute
default['openstack']['block-storage']['volume']['create_volume_group_type'] = 'file'
# String of local disk device paths
# Examples: '/dev/sdx /dev/sdx1' or '/dev/sd[k-m]1'
default['openstack']['block-storage']['volume']['block_devices'] = nil
default['openstack']['block-storage']['user'] = 'cinder'
default['openstack']['block-storage']['group'] = 'cinder'
# Cinder WSGI app SSL settings
default['openstack']['block-storage']['ssl']['enabled'] = false
default['openstack']['block-storage']['ssl']['certfile'] = ''
default['openstack']['block-storage']['ssl']['chainfile'] = ''
default['openstack']['block-storage']['ssl']['keyfile'] = ''
default['openstack']['block-storage']['ssl']['ca_certs_path'] = ''
default['openstack']['block-storage']['ssl']['cert_required'] = false
default['openstack']['block-storage']['ssl']['protocol'] = ''
default['openstack']['block-storage']['ssl']['ciphers'] = ''
case node['platform_family']
when 'rhel' # :pragma-foodcritic: ~FC024 - won't fix this
# operating system user and group names
default['openstack']['block-storage']['volume']['iscsi_helper'] = 'lioadm'
default['openstack']['block-storage']['platform'] = {
'cinder_common_packages' => ['openstack-cinder'],
'cinder_api_packages' => %w(openstack-cinder),
'cinder_api_service' => 'openstack-cinder-api',
'cinder_volume_packages' => node['platform_version'].to_i >= 8 ? %w(qemu-img) : %w(qemu-img-ev),
'cinder_volume_service' => 'openstack-cinder-volume',
'cinder_scheduler_packages' => [],
'cinder_scheduler_service' => 'openstack-cinder-scheduler',
'cinder_backup_packages' => [],
'cinder_backup_service' => 'openstack-cinder-backup',
'cinder_iscsitarget_packages' =>
if node['platform_version'].to_i >= 8
%w(targetcli python3-dbus)
else
%w(targetcli dbus-python)
end,
'cinder_iscsitarget_service' => 'target',
'cinder_lvm_packages' => %w(lvm2),
'package_overrides' => '',
}
when 'debian'
# operating system user and group names
default['openstack']['block-storage']['platform'] = {
'cinder_common_packages' => %w(cinder-common),
'cinder_api_packages' =>
%w(
python3-cinder
cinder-api
),
'cinder_api_service' => 'cinder-api',
'cinder_volume_packages' =>
%w(
python3-cinder
cinder-volume
qemu-utils
thin-provisioning-tools
),
'cinder_volume_service' => 'cinder-volume',
'cinder_scheduler_packages' => %w(python3-cinder cinder-scheduler),
'cinder_scheduler_service' => 'cinder-scheduler',
'cinder_backup_packages' => %w(python3-cinder cinder-backup),
'cinder_backup_service' => 'cinder-backup',
'cinder_iscsitarget_packages' => %w(targetcli-fb),
'cinder_iscsitarget_service' => 'tgt',
'cinder_lvm_packages' => %w(lvm2),
'package_overrides' => '',
}
end
# ******************** OpenStack Volume Endpoints *****************************
# The OpenStack Volume (Cinder) API endpoint
%w(public internal).each do |ep_type|
default['openstack']['endpoints'][ep_type]['block-storage']['scheme'] = 'http'
default['openstack']['endpoints'][ep_type]['block-storage']['path'] = '/v2/%(tenant_id)s'
default['openstack']['endpoints'][ep_type]['block-storage']['host'] = '127.0.0.1'
default['openstack']['endpoints'][ep_type]['block-storage']['port'] = '8776'
end
default['openstack']['bind_service']['all']['block-storage']['host'] = '127.0.0.1'
default['openstack']['bind_service']['all']['block-storage']['port'] = '8776'
# ============================= rootwrap Configuration ===================
# use cinder root wrap
default['openstack']['block-storage']['use_rootwrap'] = true
# rootwrap.conf
default['openstack']['block-storage']['rootwrap']['conf'].tap do |conf|
conf['DEFAULT']['filters_path'] = '/etc/cinder/rootwrap.d,/usr/share/cinder/rootwrap'
conf['DEFAULT']['exec_dirs'] = '/sbin,/usr/sbin,/bin,/usr/bin'
conf['DEFAULT']['use_syslog'] = false
conf['DEFAULT']['syslog_log_facility'] = 'syslog'
conf['DEFAULT']['syslog_log_level'] = 'ERROR'
end