Stein fixes
- Cookstyle fixes - Refactor Berksfile to use groups so we can exclude integration testing cookbooks - Update documentation - Enable sensitive resources for the template[/etc/cinder/cinder.conf] and to resources improve security. - Update delivery configuration to exclude integration cookbooks - Fix ChefSpec output. - Switch package installations to send packages as arrays instead of individual package resources. This generally speeds up chef runs. Depends-On: https://review.opendev.org/701027 Depends-On: https://review.opendev.org/706151 Depends-On: https://review.opendev.org/706157 Change-Id: I73948a67e798477cfe7d3cf62474d0ea96f90db2
This commit is contained in:
parent
873b58d13b
commit
1b39032b8d
|
@ -1 +1,9 @@
|
|||
remote_file = "https://raw.githubusercontent.com/chef-cookbooks/community_cookbook_tools/master/delivery/project.toml"
|
||||
[local_phases]
|
||||
unit = 'rspec spec/'
|
||||
lint = 'cookstyle --display-cop-names --extra-details'
|
||||
syntax = "berks install -e integration"
|
||||
provision = "echo skipping"
|
||||
deploy = "echo skipping"
|
||||
smoke = "echo skipping"
|
||||
functional = "echo skipping"
|
||||
cleanup = "echo skipping"
|
||||
|
|
16
.rubocop.yml
16
.rubocop.yml
|
@ -1,5 +1,3 @@
|
|||
inherit_from: .rubocop_todo.yml
|
||||
|
||||
AllCops:
|
||||
Include:
|
||||
- metadata.rb
|
||||
|
@ -14,17 +12,3 @@ AllCops:
|
|||
- .cookbooks/**/*
|
||||
- berks-cookbooks/**/*
|
||||
- .bundle/**/*
|
||||
|
||||
Encoding:
|
||||
Exclude:
|
||||
- metadata.rb
|
||||
- Gemfile
|
||||
|
||||
NumericLiterals:
|
||||
Enabled: false
|
||||
|
||||
LineLength:
|
||||
Enabled: false
|
||||
|
||||
WordArray:
|
||||
MinSize: 3
|
||||
|
|
|
@ -1,20 +0,0 @@
|
|||
# This configuration was generated by
|
||||
# `rubocop --auto-gen-config`
|
||||
# on 2018-08-03 05:25:43 -0700 using RuboCop version 0.55.0.
|
||||
# The point is for the user to remove these configuration records
|
||||
# one by one as the offenses are removed from the code base.
|
||||
# Note that changes in the inspected code, or installation of new
|
||||
# versions of RuboCop, may require this file to be generated again.
|
||||
|
||||
# Offense count: 2
|
||||
# Cop supports --auto-correct.
|
||||
Style/IfUnlessModifier:
|
||||
Exclude:
|
||||
- 'attributes/cinder_conf.rb'
|
||||
- 'recipes/cinder-common.rb'
|
||||
|
||||
# Offense count: 58
|
||||
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
|
||||
# URISchemes: http, https
|
||||
Metrics/LineLength:
|
||||
Max: 141
|
26
Berksfile
26
Berksfile
|
@ -2,21 +2,21 @@ source 'https://supermarket.chef.io'
|
|||
|
||||
solver :ruby, :required
|
||||
|
||||
%w(
|
||||
client
|
||||
-common
|
||||
-dns
|
||||
-identity
|
||||
-image
|
||||
-integration-test
|
||||
-network
|
||||
-ops-database
|
||||
-ops-messaging
|
||||
).each do |cookbook|
|
||||
[
|
||||
%w(client dep),
|
||||
%w(-common dep),
|
||||
%w(-dns integration),
|
||||
%w(-identity dep),
|
||||
%w(-image dep),
|
||||
%w(-integration-test integration),
|
||||
%w(-network integration),
|
||||
%w(-ops-database integration),
|
||||
%w(-ops-messaging integration),
|
||||
].each do |cookbook, group|
|
||||
if Dir.exist?("../cookbook-openstack#{cookbook}")
|
||||
cookbook "openstack#{cookbook}", path: "../cookbook-openstack#{cookbook}"
|
||||
cookbook "openstack#{cookbook}", path: "../cookbook-openstack#{cookbook}", group: group
|
||||
else
|
||||
cookbook "openstack#{cookbook}", git: "https://opendev.org/openstack/cookbook-openstack#{cookbook}"
|
||||
cookbook "openstack#{cookbook}", git: "https://opendev.org/openstack/cookbook-openstack#{cookbook}", group: group
|
||||
end
|
||||
end
|
||||
|
||||
|
|
14
README.rst
14
README.rst
|
@ -20,9 +20,9 @@ https://docs.openstack.org/cinder/latest/
|
|||
Requirements
|
||||
============
|
||||
|
||||
- Chef 14 or higher
|
||||
- chefdk 3.2.30 for testing (also includes berkshelf for cookbook
|
||||
dependency resolution)
|
||||
- Chef 15 or higher
|
||||
- Chef Workstation 0.15.18 for testing (also includes berkshelf for
|
||||
cookbook dependency resolution)
|
||||
|
||||
Platform
|
||||
========
|
||||
|
@ -39,9 +39,9 @@ The following cookbooks are dependencies:
|
|||
- 'apache2', '~> 8.0'
|
||||
- 'lvm'
|
||||
- 'openstackclient'
|
||||
- 'openstack-common', '>= 18.0.0'
|
||||
- 'openstack-identity', '>= 18.0.0'
|
||||
- 'openstack-image', '>= 18.0.0'
|
||||
- 'openstack-common', '>= 19.0.0'
|
||||
- 'openstack-identity', '>= 19.0.0'
|
||||
- 'openstack-image', '>= 19.0.0'
|
||||
|
||||
Attributes
|
||||
==========
|
||||
|
@ -152,7 +152,7 @@ License and Author
|
|||
+-----------------+---------------------------------------------------+
|
||||
| **Copyright** | Copyright (c) 2013-2015, IBM, Corp. |
|
||||
+-----------------+---------------------------------------------------+
|
||||
| **Copyright** | Copyright (c) 2019, Oregon State University |
|
||||
| **Copyright** | Copyright (c) 2019-2020, Oregon State University |
|
||||
+-----------------+---------------------------------------------------+
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
|
|
|
@ -1,13 +1,14 @@
|
|||
# encoding: UTF-8
|
||||
#
|
||||
# Cookbook Name:: openstack-block-storage
|
||||
# Cookbook:: openstack-block-storage
|
||||
# Attributes:: default
|
||||
#
|
||||
# Copyright 2012, DreamHost
|
||||
# Copyright 2012, Rackspace US, Inc.
|
||||
# Copyright 2012-2013, AT&T Services, Inc.
|
||||
# Copyright 2013, Opscode, Inc.
|
||||
# Copyright 2013-2014, IBM, Corp
|
||||
# Copyright:: 2012, DreamHost
|
||||
# Copyright:: 2012, Rackspace US, Inc.
|
||||
# Copyright:: 2012-2013, AT&T Services, Inc.
|
||||
# Copyright:: 2013, Opscode, Inc.
|
||||
# Copyright:: 2013-2014, IBM, Corp
|
||||
# Copyright:: 2020, 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.
|
||||
|
@ -87,34 +88,45 @@ when 'rhel' # :pragma-foodcritic: ~FC024 - won't fix this
|
|||
default['openstack']['block-storage']['volume']['iscsi_helper'] = 'lioadm'
|
||||
default['openstack']['block-storage']['platform'] = {
|
||||
'cinder_common_packages' => ['openstack-cinder'],
|
||||
'cinder_api_packages' => ['openstack-cinder', 'mod_wsgi'],
|
||||
'cinder_api_packages' => %w(openstack-cinder mod_wsgi),
|
||||
'cinder_api_service' => 'openstack-cinder-api',
|
||||
'cinder_volume_packages' => ['qemu-img-ev'],
|
||||
'cinder_volume_packages' => %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' => ['targetcli', 'dbus-python'],
|
||||
'cinder_iscsitarget_packages' => %w(targetcli dbus-python),
|
||||
'cinder_iscsitarget_service' => 'target',
|
||||
'cinder_lvm_packages' => ['lvm2'],
|
||||
'cinder_lvm_packages' => %w(lvm2),
|
||||
'package_overrides' => '',
|
||||
}
|
||||
when 'debian'
|
||||
# operating system user and group names
|
||||
default['openstack']['block-storage']['platform'] = {
|
||||
'cinder_common_packages' => ['cinder-common'],
|
||||
'cinder_api_packages' => ['libapache2-mod-wsgi-py3', 'python3-cinder', 'cinder-api'],
|
||||
'cinder_common_packages' => %w(cinder-common),
|
||||
'cinder_api_packages' =>
|
||||
%w(
|
||||
libapache2-mod-wsgi-py3
|
||||
python3-cinder
|
||||
cinder-api
|
||||
),
|
||||
'cinder_api_service' => 'cinder-api',
|
||||
'cinder_volume_packages' => ['python3-cinder', 'cinder-volume', 'qemu-utils', 'thin-provisioning-tools'],
|
||||
'cinder_volume_packages' =>
|
||||
%w(
|
||||
python3-cinder
|
||||
cinder-volume
|
||||
qemu-utils
|
||||
thin-provisioning-tools
|
||||
),
|
||||
'cinder_volume_service' => 'cinder-volume',
|
||||
'cinder_scheduler_packages' => ['python3-cinder', 'cinder-scheduler'],
|
||||
'cinder_scheduler_packages' => %w(python3-cinder cinder-scheduler),
|
||||
'cinder_scheduler_service' => 'cinder-scheduler',
|
||||
'cinder_backup_packages' => ['python3-cinder', 'cinder-backup'],
|
||||
'cinder_backup_packages' => %w(python3-cinder cinder-backup),
|
||||
'cinder_backup_service' => 'cinder-backup',
|
||||
'cinder_iscsitarget_packages' => ['targetcli-fb'],
|
||||
'cinder_iscsitarget_packages' => %w(targetcli-fb),
|
||||
'cinder_iscsitarget_service' => 'tgt',
|
||||
'cinder_lvm_packages' => ['lvm2'],
|
||||
'cinder_lvm_packages' => %w(lvm2),
|
||||
'package_overrides' => '',
|
||||
}
|
||||
end
|
||||
|
|
18
metadata.rb
18
metadata.rb
|
@ -3,15 +3,7 @@ maintainer 'Chef OpenStack'
|
|||
maintainer_email 'openstack-discuss@lists.openstack.org'
|
||||
license 'Apache-2.0'
|
||||
description 'The OpenStack Advanced Volume Management service Cinder.'
|
||||
version '18.0.0'
|
||||
|
||||
recipe 'api', 'Installs the cinder-api and sets up the cinder database'
|
||||
recipe 'backup', 'Installs the cinder-backup service'
|
||||
recipe 'cinder-common', 'Defines the common pieces of repeated code from the other recipes'
|
||||
recipe 'identity_registration', 'Defines the cinder service/user/endpoints in keystone'
|
||||
recipe 'scheduler', 'Installs the cinder-scheduler service'
|
||||
recipe 'volume_driver_lvm', 'Configures lvm as the cinder storage backend'
|
||||
recipe 'volume', 'Installs the cinder-volume service'
|
||||
version '19.0.0'
|
||||
|
||||
%w(ubuntu redhat centos).each do |os|
|
||||
supports os
|
||||
|
@ -20,10 +12,10 @@ end
|
|||
depends 'apache2', '~> 8.0'
|
||||
depends 'lvm'
|
||||
depends 'openstackclient'
|
||||
depends 'openstack-common', '>= 18.0.0'
|
||||
depends 'openstack-identity', '>= 18.0.0'
|
||||
depends 'openstack-image', '>= 18.0.0'
|
||||
depends 'openstack-common', '>= 19.0.0'
|
||||
depends 'openstack-identity', '>= 19.0.0'
|
||||
depends 'openstack-image', '>= 19.0.0'
|
||||
|
||||
issues_url 'https://launchpad.net/openstack-chef'
|
||||
source_url 'https://opendev.org/openstack/cookbook-openstack-block-storage'
|
||||
chef_version '>= 14.0'
|
||||
chef_version '>= 15.0'
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
# encoding: UTF-8
|
||||
#
|
||||
# Cookbook Name:: openstack-block-storage
|
||||
# Cookbook:: openstack-block-storage
|
||||
# Recipe:: api
|
||||
#
|
||||
# Copyright 2012, Rackspace US, Inc.
|
||||
# Copyright 2012-2013, AT&T Services, Inc.
|
||||
# Copyright 2013, Opscode, Inc.
|
||||
# Copyright 2013-2014, SUSE Linux Gmbh.
|
||||
# Copyright:: 2012, Rackspace US, Inc.
|
||||
# Copyright:: 2012-2013, AT&T Services, Inc.
|
||||
# Copyright:: 2013, Opscode, Inc.
|
||||
# Copyright:: 2013-2014, SUSE Linux Gmbh.
|
||||
# Copyright:: 2019-2020, 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.
|
||||
|
@ -41,18 +42,14 @@ file '/etc/apache2/conf-available/cinder-wsgi.conf' do
|
|||
only_if { platform_family? 'debian' }
|
||||
end
|
||||
|
||||
platform_options['cinder_api_packages'].each do |pkg|
|
||||
package pkg do
|
||||
options platform_options['package_overrides']
|
||||
action :upgrade
|
||||
end
|
||||
package platform_options['cinder_api_packages'] do
|
||||
options platform_options['package_overrides']
|
||||
action :upgrade
|
||||
end
|
||||
|
||||
db_type = node['openstack']['db']['block_storage']['service_type']
|
||||
node['openstack']['db']['python_packages'][db_type].each do |pkg|
|
||||
package pkg do
|
||||
action :upgrade
|
||||
end
|
||||
package node['openstack']['db']['python_packages'][db_type] do
|
||||
action :upgrade
|
||||
end
|
||||
|
||||
execute 'cinder-manage db sync' do
|
||||
|
@ -65,7 +62,7 @@ if node['openstack']['block-storage']['policyfile_url']
|
|||
source node['openstack']['block-storage']['policyfile_url']
|
||||
owner node['openstack']['block-storage']['user']
|
||||
group node['openstack']['block-storage']['group']
|
||||
mode 0o0644
|
||||
mode '644'
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
# encoding: UTF-8
|
||||
#
|
||||
# Cookbook Name:: openstack-block-storage
|
||||
# Cookbook:: openstack-block-storage
|
||||
# Recipe:: backup
|
||||
#
|
||||
# Copyright:: 2020, 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
|
||||
|
@ -20,18 +22,14 @@ include_recipe 'openstack-block-storage::cinder-common'
|
|||
|
||||
platform_options = node['openstack']['block-storage']['platform']
|
||||
|
||||
platform_options['cinder_backup_packages'].each do |pkg|
|
||||
package pkg do
|
||||
options platform_options['package_overrides']
|
||||
action :upgrade
|
||||
end
|
||||
package platform_options['cinder_backup_packages'] do
|
||||
options platform_options['package_overrides']
|
||||
action :upgrade
|
||||
end
|
||||
|
||||
db_type = node['openstack']['db']['block_storage']['service_type']
|
||||
node['openstack']['db']['python_packages'][db_type].each do |pkg|
|
||||
package pkg do
|
||||
action :upgrade
|
||||
end
|
||||
package node['openstack']['db']['python_packages'][db_type] do
|
||||
action :upgrade
|
||||
end
|
||||
|
||||
service 'cinder-backup' do
|
||||
|
|
|
@ -1,5 +1,10 @@
|
|||
# encoding: UTF-8
|
||||
#
|
||||
# Cookbook:: openstack-block-storage
|
||||
# Recipe:: cinder-common
|
||||
#
|
||||
# Copyright:: 2019-2020, Oregon State Univerity
|
||||
#
|
||||
# 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
|
||||
|
@ -22,11 +27,9 @@ end
|
|||
|
||||
platform_options = node['openstack']['block-storage']['platform']
|
||||
|
||||
platform_options['cinder_common_packages'].each do |pkg|
|
||||
package pkg do
|
||||
options platform_options['package_overrides']
|
||||
action :upgrade
|
||||
end
|
||||
package platform_options['cinder_common_packages'] do
|
||||
options platform_options['package_overrides']
|
||||
action :upgrade
|
||||
end
|
||||
|
||||
db_user = node['openstack']['db']['block_storage']['username']
|
||||
|
@ -42,7 +45,8 @@ if node['openstack']['endpoints']['db']['enabled_slave']
|
|||
end
|
||||
|
||||
if node['openstack']['mq']['service_type'] == 'rabbit'
|
||||
node.default['openstack']['block-storage']['conf_secrets']['DEFAULT']['transport_url'] = rabbit_transport_url 'block_storage'
|
||||
node.default['openstack']['block-storage']['conf_secrets']['DEFAULT']['transport_url'] =
|
||||
rabbit_transport_url 'block_storage'
|
||||
end
|
||||
|
||||
glance_api_endpoint = internal_endpoint 'image_api'
|
||||
|
@ -58,7 +62,7 @@ auth_url = ::URI.decode identity_endpoint.to_s
|
|||
directory '/etc/cinder' do
|
||||
group node['openstack']['block-storage']['group']
|
||||
owner node['openstack']['block-storage']['user']
|
||||
mode 0o0750
|
||||
mode '750'
|
||||
action :create
|
||||
end
|
||||
|
||||
|
@ -98,7 +102,8 @@ template '/etc/cinder/cinder.conf' do
|
|||
cookbook 'openstack-common'
|
||||
group node['openstack']['block-storage']['group']
|
||||
owner node['openstack']['block-storage']['user']
|
||||
mode 0o0640
|
||||
mode '640'
|
||||
sensitive true
|
||||
variables(
|
||||
service_config: cinder_conf_options
|
||||
)
|
||||
|
@ -117,7 +122,7 @@ directory node['openstack']['block-storage']['conf']['oslo_concurrency']['lock_p
|
|||
group node['openstack']['block-storage']['group']
|
||||
owner node['openstack']['block-storage']['user']
|
||||
recursive true
|
||||
mode 0o0755
|
||||
mode '755'
|
||||
end
|
||||
|
||||
if node['openstack']['block-storage']['use_rootwrap']
|
||||
|
@ -126,7 +131,7 @@ if node['openstack']['block-storage']['use_rootwrap']
|
|||
cookbook 'openstack-common'
|
||||
owner 'root'
|
||||
group 'root'
|
||||
mode 0o0644
|
||||
mode '644'
|
||||
variables(
|
||||
service_config: node['openstack']['block-storage']['rootwrap']['conf']
|
||||
)
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
# encoding: UTF-8
|
||||
#
|
||||
# Cookbook Name:: openstack-block-storage
|
||||
# Cookbook:: openstack-block-storage
|
||||
# Recipe:: identity_registration
|
||||
#
|
||||
# Copyright 2012, Rackspace US, Inc.
|
||||
# Copyright 2012-2013, AT&T Services, Inc.
|
||||
# Copyright 2013, Opscode, Inc.
|
||||
# Copyright:: 2012, Rackspace US, Inc.
|
||||
# Copyright:: 2012-2013, AT&T Services, Inc.
|
||||
# Copyright:: 2013, Opscode, Inc.
|
||||
# Copyright:: 2019, 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.
|
||||
|
@ -47,11 +48,11 @@ service_name = node['openstack']['block-storage']['service_name']
|
|||
service_type = node['openstack']['block-storage']['service_type']
|
||||
|
||||
connection_params = {
|
||||
openstack_auth_url: auth_url,
|
||||
openstack_username: admin_user,
|
||||
openstack_api_key: admin_pass,
|
||||
openstack_auth_url: auth_url,
|
||||
openstack_username: admin_user,
|
||||
openstack_api_key: admin_pass,
|
||||
openstack_project_name: admin_project,
|
||||
openstack_domain_name: admin_domain,
|
||||
openstack_domain_name: admin_domain,
|
||||
}
|
||||
|
||||
# Register Volume Service
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
# encoding: UTF-8
|
||||
#
|
||||
# Cookbook Name:: openstack-block-storage
|
||||
# Cookbook:: openstack-block-storage
|
||||
# Recipe:: scheduler
|
||||
#
|
||||
# Copyright 2012, Rackspace US, Inc.
|
||||
# Copyright 2012-2013, AT&T Services, Inc.
|
||||
# Copyright 2013, Opscode, Inc.
|
||||
# Copyright 2013-2014, SUSE Linux Gmbh.
|
||||
# Copyright:: 2012, Rackspace US, Inc.
|
||||
# Copyright:: 2012-2013, AT&T Services, Inc.
|
||||
# Copyright:: 2013, Opscode, Inc.
|
||||
# Copyright:: 2013-2014, SUSE Linux Gmbh.
|
||||
# Copyright:: 2020, 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.
|
||||
|
@ -25,18 +26,14 @@ include_recipe 'openstack-block-storage::cinder-common'
|
|||
|
||||
platform_options = node['openstack']['block-storage']['platform']
|
||||
|
||||
platform_options['cinder_scheduler_packages'].each do |pkg|
|
||||
package pkg do
|
||||
options platform_options['package_overrides']
|
||||
action :upgrade
|
||||
end
|
||||
package platform_options['cinder_scheduler_packages'] do
|
||||
options platform_options['package_overrides']
|
||||
action :upgrade
|
||||
end
|
||||
|
||||
db_type = node['openstack']['db']['block_storage']['service_type']
|
||||
node['openstack']['db']['python_packages'][db_type].each do |pkg|
|
||||
package pkg do
|
||||
action :upgrade
|
||||
end
|
||||
package node['openstack']['db']['python_packages'][db_type] do
|
||||
action :upgrade
|
||||
end
|
||||
|
||||
service 'cinder-scheduler' do
|
||||
|
|
|
@ -1,13 +1,14 @@
|
|||
# encoding: UTF-8
|
||||
#
|
||||
# Cookbook Name:: openstack-block-storage
|
||||
# Cookbook:: openstack-block-storage
|
||||
# Recipe:: volume
|
||||
#
|
||||
# Copyright 2012, Rackspace US, Inc.
|
||||
# Copyright 2012-2013, AT&T Services, Inc.
|
||||
# Copyright 2013, Opscode, Inc.
|
||||
# Copyright 2013-2014, SUSE Linux Gmbh.
|
||||
# Copyright 2013, IBM, Corp.
|
||||
# Copyright:: 2012, Rackspace US, Inc.
|
||||
# Copyright:: 2012-2013, AT&T Services, Inc.
|
||||
# Copyright:: 2013, Opscode, Inc.
|
||||
# Copyright:: 2013-2014, SUSE Linux Gmbh.
|
||||
# Copyright:: 2013, IBM, Corp.
|
||||
# Copyright:: 2020, 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.
|
||||
|
@ -31,25 +32,19 @@ include_recipe 'openstack-block-storage::cinder-common'
|
|||
|
||||
platform_options = node['openstack']['block-storage']['platform']
|
||||
|
||||
platform_options['cinder_volume_packages'].each do |pkg|
|
||||
package pkg do
|
||||
options platform_options['package_overrides']
|
||||
action :upgrade
|
||||
end
|
||||
package platform_options['cinder_volume_packages'] do
|
||||
options platform_options['package_overrides']
|
||||
action :upgrade
|
||||
end
|
||||
|
||||
db_type = node['openstack']['db']['block_storage']['service_type']
|
||||
node['openstack']['db']['python_packages'][db_type].each do |pkg|
|
||||
package pkg do
|
||||
action :upgrade
|
||||
end
|
||||
package node['openstack']['db']['python_packages'][db_type] do
|
||||
action :upgrade
|
||||
end
|
||||
|
||||
platform_options['cinder_iscsitarget_packages'].each do |pkg|
|
||||
package pkg do
|
||||
options platform_options['package_overrides']
|
||||
action :upgrade
|
||||
end
|
||||
package platform_options['cinder_iscsitarget_packages'] do
|
||||
options platform_options['package_overrides']
|
||||
action :upgrade
|
||||
end
|
||||
|
||||
service 'cinder-volume' do
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
# encoding: UTF-8
|
||||
#
|
||||
# Cookbook Name:: openstack-block-storage
|
||||
# Cookbook:: openstack-block-storage
|
||||
# Recipe:: volume_driver_lvm
|
||||
#
|
||||
# Copyright:: 2020, 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
|
||||
|
@ -17,11 +19,9 @@
|
|||
#
|
||||
|
||||
platform_options = node['openstack']['block-storage']['platform']
|
||||
platform_options['cinder_lvm_packages'].each do |pkg|
|
||||
package pkg do
|
||||
options platform_options['package_overrides']
|
||||
action :upgrade
|
||||
end
|
||||
package platform_options['cinder_lvm_packages'] do
|
||||
options platform_options['package_overrides']
|
||||
action :upgrade
|
||||
end
|
||||
|
||||
# TODO: (jklare) this whole section should be refactored and probably include an
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# encoding: UTF-8
|
||||
#
|
||||
# Cookbook Name:: openstack-block-storage
|
||||
# Cookbook:: openstack-block-storage
|
||||
|
||||
require_relative 'spec_helper'
|
||||
|
||||
|
@ -16,9 +16,8 @@ describe 'openstack-block-storage::api' do
|
|||
expect(chef_run).to_not create_file('/etc/apache2/conf-available/cinder-wsgi.conf')
|
||||
end
|
||||
|
||||
it 'upgrades cinder api package' do
|
||||
expect(chef_run).to upgrade_package 'openstack-cinder'
|
||||
expect(chef_run).to upgrade_package 'mod_wsgi'
|
||||
it do
|
||||
expect(chef_run).to upgrade_package %w(openstack-cinder mod_wsgi)
|
||||
end
|
||||
|
||||
it 'upgrades mysql python package' do
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# encoding: UTF-8
|
||||
#
|
||||
# Cookbook Name:: openstack-block-storage
|
||||
# Cookbook:: openstack-block-storage
|
||||
|
||||
require_relative 'spec_helper'
|
||||
|
||||
|
@ -23,10 +23,8 @@ describe 'openstack-block-storage::api' do
|
|||
)
|
||||
end
|
||||
|
||||
it 'upgrades cinder api packages' do
|
||||
expect(chef_run).to upgrade_package('libapache2-mod-wsgi-py3')
|
||||
expect(chef_run).to upgrade_package('python3-cinder')
|
||||
expect(chef_run).to upgrade_package('cinder-api')
|
||||
it do
|
||||
expect(chef_run).to upgrade_package %w(libapache2-mod-wsgi-py3 python3-cinder cinder-api)
|
||||
end
|
||||
|
||||
it 'upgrades mysql python3 package' do
|
||||
|
@ -162,7 +160,7 @@ describe 'openstack-block-storage::api' do
|
|||
expect(chef_run).to create_remote_file('/etc/cinder/policy.json').with(
|
||||
user: 'cinder',
|
||||
group: 'cinder',
|
||||
mode: 0o0644
|
||||
mode: '644'
|
||||
)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# encoding: UTF-8
|
||||
#
|
||||
# Cookbook Name:: openstack-block-storage
|
||||
# Cookbook:: openstack-block-storage
|
||||
|
||||
require_relative 'spec_helper'
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# encoding: UTF-8
|
||||
#
|
||||
# Cookbook Name:: openstack-block-storage
|
||||
# Cookbook:: openstack-block-storage
|
||||
|
||||
require_relative 'spec_helper'
|
||||
|
||||
|
@ -13,8 +13,8 @@ describe 'openstack-block-storage::backup' do
|
|||
include_context 'block-storage-stubs'
|
||||
|
||||
describe 'enable cinder backup service' do
|
||||
it 'upgrades cinder backup package' do
|
||||
expect(chef_run).to upgrade_package 'cinder-backup'
|
||||
it do
|
||||
expect(chef_run).to upgrade_package %w(python3-cinder cinder-backup)
|
||||
end
|
||||
|
||||
it 'starts cinder backup' do
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# encoding: UTF-8
|
||||
#
|
||||
# Cookbook Name:: openstack-block-storage
|
||||
# Cookbook:: openstack-block-storage
|
||||
|
||||
require_relative 'spec_helper'
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# encoding: utf-8
|
||||
#
|
||||
# Cookbook Name:: openstack-block-storage
|
||||
# Cookbook:: openstack-block-storage
|
||||
|
||||
require_relative 'spec_helper'
|
||||
|
||||
|
@ -36,7 +36,7 @@ describe 'openstack-block-storage::cinder-common' do
|
|||
expect(chef_run).to create_directory(dir.name).with(
|
||||
owner: 'cinder',
|
||||
group: 'cinder',
|
||||
mode: 0o0750
|
||||
mode: '750'
|
||||
)
|
||||
end
|
||||
end
|
||||
|
@ -46,9 +46,12 @@ describe 'openstack-block-storage::cinder-common' do
|
|||
|
||||
it 'should create the cinder.conf template' do
|
||||
expect(chef_run).to create_template(file.name).with(
|
||||
source: 'openstack-service.conf.erb',
|
||||
cookbook: 'openstack-common',
|
||||
owner: 'cinder',
|
||||
group: 'cinder',
|
||||
mode: 0o0640
|
||||
mode: '640',
|
||||
sensitive: true
|
||||
)
|
||||
end
|
||||
|
||||
|
@ -168,7 +171,7 @@ describe 'openstack-block-storage::cinder-common' do
|
|||
expect(chef_run).to create_directory(dir.name).with(
|
||||
user: 'cinder',
|
||||
group: 'cinder',
|
||||
mode: 0o0755
|
||||
mode: '755'
|
||||
)
|
||||
end
|
||||
end
|
||||
|
@ -180,7 +183,7 @@ describe 'openstack-block-storage::cinder-common' do
|
|||
expect(chef_run).to create_template(file.name).with(
|
||||
user: 'root',
|
||||
group: 'root',
|
||||
mode: 0o644
|
||||
mode: '644'
|
||||
)
|
||||
end
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# encoding: UTF-8
|
||||
#
|
||||
# Cookbook Name:: openstack-block-storage
|
||||
# Cookbook:: openstack-block-storage
|
||||
|
||||
require_relative 'spec_helper'
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# encoding: UTF-8
|
||||
#
|
||||
# Cookbook Name:: openstack-block-storage
|
||||
# Cookbook:: openstack-block-storage
|
||||
|
||||
require_relative 'spec_helper'
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# encoding: UTF-8
|
||||
#
|
||||
# Cookbook Name:: openstack-block-storage
|
||||
# Cookbook:: openstack-block-storage
|
||||
|
||||
require_relative 'spec_helper'
|
||||
|
||||
|
@ -14,8 +14,8 @@ describe 'openstack-block-storage::scheduler' do
|
|||
include_examples 'common-logging'
|
||||
include_examples 'creates_cinder_conf', 'service[cinder-scheduler]', 'cinder', 'cinder'
|
||||
|
||||
it 'upgrades cinder scheduler package' do
|
||||
expect(chef_run).to upgrade_package 'cinder-scheduler'
|
||||
it do
|
||||
expect(chef_run).to upgrade_package %w(python3-cinder cinder-scheduler)
|
||||
end
|
||||
|
||||
it 'starts cinder scheduler' do
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# encoding: UTF-8
|
||||
#
|
||||
# Cookbook Name:: openstack-block-storage
|
||||
# Cookbook:: openstack-block-storage
|
||||
|
||||
require 'chefspec'
|
||||
require 'chefspec/berkshelf'
|
||||
|
@ -126,7 +126,7 @@ shared_examples 'creates_cinder_conf' do |service, user, group, action = :restar
|
|||
expect(chef_run).to create_template(file.name).with(
|
||||
user: user,
|
||||
group: group,
|
||||
mode: 0o640
|
||||
mode: '640'
|
||||
)
|
||||
end
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# encoding: UTF-8
|
||||
#
|
||||
# Cookbook Name:: openstack-block-storage
|
||||
# Cookbook:: openstack-block-storage
|
||||
|
||||
require_relative 'spec_helper'
|
||||
|
||||
|
@ -20,8 +20,8 @@ describe 'openstack-block-storage::volume' do
|
|||
expect(chef_run).to upgrade_package('qemu-img-ev')
|
||||
end
|
||||
|
||||
it 'upgrades cinder iscsi package' do
|
||||
expect(chef_run).to upgrade_package('targetcli')
|
||||
it do
|
||||
expect(chef_run).to upgrade_package %w(targetcli dbus-python)
|
||||
end
|
||||
|
||||
it 'starts cinder volume' do
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# encoding: UTF-8
|
||||
#
|
||||
# Cookbook Name:: openstack-block-storage
|
||||
# Cookbook:: openstack-block-storage
|
||||
|
||||
require_relative 'spec_helper'
|
||||
|
||||
|
@ -14,16 +14,8 @@ describe 'openstack-block-storage::volume' do
|
|||
include_examples 'common-logging'
|
||||
include_examples 'creates_cinder_conf', 'service[cinder-volume]', 'cinder', 'cinder'
|
||||
|
||||
it 'upgrades cinder volume packages' do
|
||||
expect(chef_run).to upgrade_package 'cinder-volume'
|
||||
end
|
||||
|
||||
it 'upgrades qemu utils package' do
|
||||
expect(chef_run).to upgrade_package 'qemu-utils'
|
||||
end
|
||||
|
||||
it 'upgrades thin provisioning tools package' do
|
||||
expect(chef_run).to upgrade_package 'thin-provisioning-tools'
|
||||
it do
|
||||
expect(chef_run).to upgrade_package %w(python3-cinder cinder-volume qemu-utils thin-provisioning-tools)
|
||||
end
|
||||
|
||||
it 'starts cinder volume' do
|
||||
|
|
Loading…
Reference in New Issue