Retire openstack-chef: remove repo content
OpenStack-chef project is retiring - https://review.opendev.org/c/openstack/governance/+/905279 this commit remove the content of this project repo Depends-On: https://review.opendev.org/c/openstack/project-config/+/909134 Change-Id: Id5659595c1a67540fff5434197a06d33cdb9d85e
This commit is contained in:
parent
08f84ac085
commit
a048e1094b
|
@ -1,9 +0,0 @@
|
|||
[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"
|
|
@ -1,9 +0,0 @@
|
|||
.bundle/
|
||||
berks-cookbooks/
|
||||
.kitchen
|
||||
.vagrant
|
||||
.coverage/
|
||||
*.swp
|
||||
Berksfile.lock
|
||||
Vagrantfile
|
||||
Gemfile.lock
|
|
@ -1,4 +0,0 @@
|
|||
Chef/Modernize/FoodcriticComments:
|
||||
Enabled: true
|
||||
Chef/Style/CopyrightCommentFormat:
|
||||
Enabled: true
|
|
@ -1,3 +0,0 @@
|
|||
- project:
|
||||
templates:
|
||||
- openstack-chef-jobs
|
23
Berksfile
23
Berksfile
|
@ -1,23 +0,0 @@
|
|||
source 'https://supermarket.chef.io'
|
||||
|
||||
solver :ruby, :required
|
||||
|
||||
[
|
||||
%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}", group: group
|
||||
else
|
||||
cookbook "openstack#{cookbook}", git: "https://opendev.org/openstack/cookbook-openstack#{cookbook}", group: group
|
||||
end
|
||||
end
|
||||
|
||||
metadata
|
|
@ -1,36 +0,0 @@
|
|||
Contributing
|
||||
============
|
||||
|
||||
How To Get Started
|
||||
------------------
|
||||
|
||||
If you would like to contribute to the development of OpenStack Chef Cookbooks,
|
||||
you must follow the steps in this page:
|
||||
|
||||
http://docs.openstack.org/infra/manual/developers.html
|
||||
|
||||
Gerrit Workflow
|
||||
---------------
|
||||
|
||||
Once those steps have been completed, changes to OpenStack
|
||||
should be submitted for review via the Gerrit tool, following
|
||||
the workflow documented at:
|
||||
|
||||
http://docs.openstack.org/infra/manual/developers.html#development-workflow
|
||||
|
||||
Pull requests submitted through GitHub will be ignored.
|
||||
|
||||
Bugs
|
||||
----
|
||||
|
||||
Bugs should be filed on Launchpad, not GitHub:
|
||||
|
||||
https://bugs.launchpad.net/openstack-chef
|
||||
|
||||
Contacts
|
||||
--------
|
||||
|
||||
Mailing list: groups.google.com/group/opscode-chef-openstack
|
||||
IRC: #openstack-chef is our channel on irc.oftc.net
|
||||
Wiki: https://wiki.openstack.org/wiki/Chef/GettingStarted and https://docs.getchef.com/openstack.html
|
||||
Twitter: @chefopenstack
|
176
LICENSE
176
LICENSE
|
@ -1,176 +0,0 @@
|
|||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
176
README.rst
176
README.rst
|
@ -1,170 +1,10 @@
|
|||
OpenStack Chef Cookbook - block-storage
|
||||
=======================================
|
||||
This project is no longer maintained.
|
||||
|
||||
.. image:: https://governance.openstack.org/tc/badges/cookbook-openstack-block-storage.svg
|
||||
:target: https://governance.openstack.org/reference/tags/index.html
|
||||
The contents of this repository are still available in the Git
|
||||
source code management system. To see the contents of this
|
||||
repository before it reached its end of life, please check out the
|
||||
previous commit with "git checkout HEAD^1".
|
||||
|
||||
Description
|
||||
===========
|
||||
|
||||
Installs the OpenStack Block Storage service **Cinder** as part of the
|
||||
OpenStack reference deployment Chef for OpenStack. The `OpenStack
|
||||
chef-repo`_ contains documentation for using this cookbook in the
|
||||
context of a full OpenStack deployment. Cinder is currently installed
|
||||
from packages.
|
||||
|
||||
.. _OpenStack chef-repo: https://opendev.org/openstack/openstack-chef
|
||||
|
||||
https://docs.openstack.org/cinder/latest/
|
||||
|
||||
Requirements
|
||||
============
|
||||
|
||||
- Chef 16 or higher
|
||||
- Chef Workstation 21.10.640 for testing (also includes berkshelf for
|
||||
cookbook dependency resolution)
|
||||
|
||||
Platform
|
||||
========
|
||||
|
||||
- ubuntu
|
||||
- redhat
|
||||
- centos
|
||||
|
||||
Cookbooks
|
||||
=========
|
||||
|
||||
The following cookbooks are dependencies:
|
||||
|
||||
- 'apache2', '~> 8.6'
|
||||
- 'lvm'
|
||||
- 'openstackclient'
|
||||
- 'openstack-common', '>= 20.0.0'
|
||||
- 'openstack-identity', '>= 20.0.0'
|
||||
- 'openstack-image', '>= 20.0.0'
|
||||
|
||||
Attributes
|
||||
==========
|
||||
|
||||
Please see the extensive inline documentation in ``attributes/*.rb`` for
|
||||
descriptions of all the settable attributes for this cookbook.
|
||||
|
||||
Note that all attributes are in the ``default['openstack']`` "namespace"
|
||||
|
||||
The usage of attributes to generate the ``cinder.conf`` is described in the
|
||||
openstack-common cookbook.
|
||||
|
||||
Recipes
|
||||
=======
|
||||
|
||||
openstack-block-storage::api
|
||||
----------------------------
|
||||
|
||||
- Installs the cinder-api and sets up the cinder database
|
||||
|
||||
openstack-block-storage::backup
|
||||
-------------------------------
|
||||
|
||||
- Installs the cinder-backup service
|
||||
|
||||
openstack-block-storage::cinder-common
|
||||
--------------------------------------
|
||||
|
||||
- Defines the common pieces of repeated code from the other recipes
|
||||
|
||||
openstack-block-storage::identity_registration
|
||||
-----------------------------------------------
|
||||
|
||||
- Defines the cinder service/user/endpoints in keystone
|
||||
|
||||
openstack-block-storage::scheduler
|
||||
----------------------------------
|
||||
|
||||
- Installs the cinder-scheduler service
|
||||
|
||||
openstack-block-storage::volume_driver_lvm
|
||||
--------------------------------------------
|
||||
|
||||
- Configures lvm as the cinder storage backend
|
||||
|
||||
openstack-block-storage::volume
|
||||
-------------------------------
|
||||
|
||||
- Installs the cinder-volume service
|
||||
|
||||
License and Author
|
||||
==================
|
||||
|
||||
+-----------------+---------------------------------------------------+
|
||||
| **Author** | Justin Shepherd (justin.shepherd@rackspace.com) |
|
||||
+-----------------+---------------------------------------------------+
|
||||
| **Author** | Jason Cannavale (jason.cannavale@rackspace.com) |
|
||||
+-----------------+---------------------------------------------------+
|
||||
| **Author** | Ron Pedde (ron.pedde@rackspace.com) |
|
||||
+-----------------+---------------------------------------------------+
|
||||
| **Author** | Joseph Breu (joseph.breu@rackspace.com) |
|
||||
+-----------------+---------------------------------------------------+
|
||||
| **Author** | William Kelly (william.kelly@rackspace.com) |
|
||||
+-----------------+---------------------------------------------------+
|
||||
| **Author** | Darren Birkett (darren.birkett@rackspace.co.uk) |
|
||||
+-----------------+---------------------------------------------------+
|
||||
| **Author** | Evan Callicoat (evan.callicoat@rackspace.com) |
|
||||
+-----------------+---------------------------------------------------+
|
||||
| **Author** | Matt Ray (matt@opscode.com) |
|
||||
+-----------------+---------------------------------------------------+
|
||||
| **Author** | Jay Pipes (jaypipes@att.com) |
|
||||
+-----------------+---------------------------------------------------+
|
||||
| **Author** | John Dewey (jdewey@att.com) |
|
||||
+-----------------+---------------------------------------------------+
|
||||
| **Author** | Abel Lopez (al592b@att.com) |
|
||||
+-----------------+---------------------------------------------------+
|
||||
| **Author** | Sean Gallagher (sean.gallagher@att.com) |
|
||||
+-----------------+---------------------------------------------------+
|
||||
| **Author** | Ionut Artarisi (iartarisi@suse.cz) |
|
||||
+-----------------+---------------------------------------------------+
|
||||
| **Author** | David Geng (gengjh@cn.ibm.com) |
|
||||
+-----------------+---------------------------------------------------+
|
||||
| **Author** | Salman Baset (sabaset@us.ibm.com) |
|
||||
+-----------------+---------------------------------------------------+
|
||||
| **Author** | Chen Zhiwei (zhiwchen@cn.ibm.com) |
|
||||
+-----------------+---------------------------------------------------+
|
||||
| **Author** | Mark Vanderwiel (vanderwl@us.ibm.com) |
|
||||
+-----------------+---------------------------------------------------+
|
||||
| **Author** | Eric Zhou (zyouzhou@cn.ibm.com) |
|
||||
+-----------------+---------------------------------------------------+
|
||||
| **Author** | Edwin Wang (edwin.wang@cn.ibm.com) |
|
||||
+-----------------+---------------------------------------------------+
|
||||
| **Author** | Jan Klare (j.klare@cloudbau.de) |
|
||||
+-----------------+---------------------------------------------------+
|
||||
| **Author** | Christoph Albers (c.albers@x-ion.de) |
|
||||
+-----------------+---------------------------------------------------+
|
||||
| **Author** | Lance Albertson (lance@osuosl.org) |
|
||||
+-----------------+---------------------------------------------------+
|
||||
|
||||
+-----------------+---------------------------------------------------+
|
||||
| **Copyright** | Copyright (c) 2012, Rackspace US, Inc. |
|
||||
+-----------------+---------------------------------------------------+
|
||||
| **Copyright** | Copyright (c) 2012-2013, AT&T Services, Inc. |
|
||||
+-----------------+---------------------------------------------------+
|
||||
| **Copyright** | Copyright (c) 2013, Opscode, Inc. |
|
||||
+-----------------+---------------------------------------------------+
|
||||
| **Copyright** | Copyright (c) 2013-2014, SUSE Linux GmbH |
|
||||
+-----------------+---------------------------------------------------+
|
||||
| **Copyright** | Copyright (c) 2013-2015, IBM, Corp. |
|
||||
+-----------------+---------------------------------------------------+
|
||||
| **Copyright** | Copyright (c) 2019-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.
|
||||
For any further questions, please email
|
||||
openstack-discuss@lists.openstack.org or join #openstack-dev on
|
||||
OFTC.
|
||||
|
|
39
Rakefile
39
Rakefile
|
@ -1,39 +0,0 @@
|
|||
task default: ['test']
|
||||
|
||||
task test: [:syntax, :lint, :unit]
|
||||
|
||||
desc 'Vendor the cookbooks in the Berksfile'
|
||||
task :berks_prep do
|
||||
sh %(chef exec berks vendor)
|
||||
end
|
||||
|
||||
desc 'Run FoodCritic (syntax) tests'
|
||||
task :syntax do
|
||||
sh %(chef exec foodcritic --exclude spec -f any .)
|
||||
end
|
||||
|
||||
desc 'Run RuboCop (lint) tests'
|
||||
task :lint do
|
||||
sh %(chef exec cookstyle)
|
||||
end
|
||||
|
||||
desc 'Run RSpec (unit) tests'
|
||||
task unit: :berks_prep do
|
||||
sh %(chef exec rspec --format documentation)
|
||||
end
|
||||
|
||||
desc 'Remove the berks-cookbooks directory and the Berksfile.lock'
|
||||
task :clean do
|
||||
rm_rf [
|
||||
'berks-cookbooks',
|
||||
'Berksfile.lock',
|
||||
]
|
||||
end
|
||||
|
||||
desc 'All-in-One Neutron build Infra using Common task'
|
||||
task :integration do
|
||||
# Use the common integration task
|
||||
sh %(wget -nv -t 3 -O Rakefile-Common https://opendev.org/openstack/cookbook-openstack-common/raw/branch/master/Rakefile)
|
||||
load './Rakefile-Common'
|
||||
Rake::Task['common_integration'].invoke
|
||||
end
|
30
TESTING.md
30
TESTING.md
|
@ -1,30 +0,0 @@
|
|||
# Testing the Cookbook #
|
||||
|
||||
This cookbook uses [chefdk](https://downloads.chef.io/chef-dk/) and [berkshelf](http://berkshelf.com/) to isolate dependencies. Make sure you have chefdk and the header files for `gecode` installed before continuing. Make sure that you're using gecode version 3. More info [here](https://github.com/opscode/dep-selector-libgecode/tree/0bad63fea305ede624c58506423ced697dd2545e#using-a-system-gecode-instead). For more detailed information on what needs to be installed, you can have a quick look into the bootstrap.sh file in this repository, which does install all the needed things to get going on ubuntu trusty. The tests defined in the Rakefile include lint, style and unit. For integration testing please refere to the [openstack-chef-repo](https://github.com/openstack/openstack-chef-repo).
|
||||
|
||||
We have three test suites which you can run either, individually (there are three rake tasks):
|
||||
|
||||
$ chef exec rake lint
|
||||
$ chef exec rake style
|
||||
$ chef exec rake unit
|
||||
|
||||
or altogether:
|
||||
|
||||
$ chef exec rake
|
||||
|
||||
The `rake` tasks will take care of installing the needed cookbooks with `berkshelf`.
|
||||
|
||||
## Rubocop ##
|
||||
|
||||
[Rubocop](https://github.com/bbatsov/rubocop) is a static Ruby code analyzer, based on the community [Ruby style guide](https://github.com/bbatsov/ruby-style-guide). We are attempting to adhere to this where applicable, slowly cleaning up the cookbooks until we can turn on Rubocop for gating the commits.
|
||||
|
||||
## Foodcritic ##
|
||||
|
||||
[Foodcritic](http://acrmp.github.io/foodcritic/) is a lint tool for Chef cookbooks. We ignore the following rules:
|
||||
|
||||
* [FC003](http://acrmp.github.io/foodcritic/#FC003) These cookbooks are not intended for Chef Solo.
|
||||
* [FC023](http://acrmp.github.io/foodcritic/#FC023) Prefer conditional attributes.
|
||||
|
||||
## Chefspec
|
||||
|
||||
[ChefSpec](https://github.com/sethvargo/chefspec) is a unit testing framework for testing Chef cookbooks. ChefSpec makes it easy to write examples and get fast feedback on cookbook changes without the need for virtual machines or cloud servers.
|
|
@ -1,26 +0,0 @@
|
|||
default['openstack']['block-storage']['conf_secrets'] = {}
|
||||
default['openstack']['block-storage']['conf'].tap do |conf|
|
||||
conf['oslo_messaging_notifications']['driver'] = 'cinder.openstack.common.notifier.rpc_notifier'
|
||||
if node['openstack']['block-storage']['syslog']['use']
|
||||
conf['DEFAULT']['log_config'] = '/etc/openstack/logging.conf'
|
||||
end
|
||||
conf['DEFAULT']['auth_strategy'] = 'keystone'
|
||||
conf['DEFAULT']['control_exchange'] = 'cinder'
|
||||
conf['DEFAULT']['glance_api_version'] = '2'
|
||||
conf['DEFAULT']['volume_group'] = 'cinder-volumes'
|
||||
conf['DEFAULT']['state_path'] = '/var/lib/cinder'
|
||||
conf['keystone_authtoken']['auth_type'] = 'password'
|
||||
conf['keystone_authtoken']['region_name'] = node['openstack']['region']
|
||||
conf['keystone_authtoken']['username'] = 'cinder'
|
||||
conf['keystone_authtoken']['project_name'] = 'service'
|
||||
conf['keystone_authtoken']['user_domain_name'] = 'Default'
|
||||
conf['keystone_authtoken']['project_domain_name'] = 'Default'
|
||||
conf['nova']['auth_type'] = 'password'
|
||||
conf['nova']['region_name'] = node['openstack']['region']
|
||||
conf['nova']['username'] = 'nova'
|
||||
conf['nova']['project_name'] = 'service'
|
||||
conf['nova']['user_domain_name'] = 'Default'
|
||||
conf['nova']['project_domain_name'] = 'Default'
|
||||
|
||||
conf['oslo_concurrency']['lock_path'] = '/var/lib/cinder/tmp'
|
||||
end
|
|
@ -1,158 +0,0 @@
|
|||
#
|
||||
# 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
|
|
@ -1 +0,0 @@
|
|||
include /var/lib/cinder/volumes/*
|
21
metadata.rb
21
metadata.rb
|
@ -1,21 +0,0 @@
|
|||
name 'openstack-block-storage'
|
||||
maintainer 'Chef OpenStack'
|
||||
maintainer_email 'openstack-discuss@lists.openstack.org'
|
||||
license 'Apache-2.0'
|
||||
description 'The OpenStack Advanced Volume Management service Cinder.'
|
||||
version '20.0.0'
|
||||
|
||||
%w(ubuntu redhat centos).each do |os|
|
||||
supports os
|
||||
end
|
||||
|
||||
depends 'apache2', '~> 8.6'
|
||||
depends 'lvm'
|
||||
depends 'openstackclient'
|
||||
depends 'openstack-common', '>= 20.0.0'
|
||||
depends 'openstack-identity', '>= 20.0.0'
|
||||
depends 'openstack-image', '>= 20.0.0'
|
||||
|
||||
issues_url 'https://launchpad.net/openstack-chef'
|
||||
source_url 'https://opendev.org/openstack/cookbook-openstack-block-storage'
|
||||
chef_version '>= 16.0'
|
106
recipes/api.rb
106
recipes/api.rb
|
@ -1,106 +0,0 @@
|
|||
#
|
||||
# Cookbook:: openstack-block-storage
|
||||
# Recipe:: api
|
||||
#
|
||||
# Copyright:: 2012-2021, Rackspace US, Inc.
|
||||
# Copyright:: 2012-2021, AT&T Services, Inc.
|
||||
# Copyright:: 2013-2021, Chef Software, Inc.
|
||||
# Copyright:: 2013-2021, SUSE Linux Gmbh.
|
||||
# Copyright:: 2019-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.
|
||||
#
|
||||
# Make Openstack object available in Chef::Recipe
|
||||
class ::Chef::Recipe
|
||||
include ::Openstack
|
||||
include Apache2::Cookbook::Helpers
|
||||
end
|
||||
|
||||
include_recipe 'openstack-block-storage::cinder-common'
|
||||
|
||||
bind_service = node['openstack']['bind_service']['all']['block-storage']
|
||||
platform_options = node['openstack']['block-storage']['platform']
|
||||
|
||||
# create file to prevent installation of non-working configuration
|
||||
file '/etc/apache2/conf-available/cinder-wsgi.conf' do
|
||||
owner 'root'
|
||||
group 'www-data'
|
||||
mode '0640'
|
||||
action :create
|
||||
content '# Chef openstack-block-storage: file to block config from package'
|
||||
only_if { platform_family? 'debian' }
|
||||
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']
|
||||
package node['openstack']['db']['python_packages'][db_type] do
|
||||
action :upgrade
|
||||
end
|
||||
|
||||
execute 'cinder-manage db sync' do
|
||||
user node['openstack']['block-storage']['user']
|
||||
group node['openstack']['block-storage']['group']
|
||||
end
|
||||
|
||||
if node['openstack']['block-storage']['policyfile_url']
|
||||
remote_file '/etc/cinder/policy.json' do
|
||||
source node['openstack']['block-storage']['policyfile_url']
|
||||
owner node['openstack']['block-storage']['user']
|
||||
group node['openstack']['block-storage']['group']
|
||||
mode '644'
|
||||
end
|
||||
end
|
||||
|
||||
# Finds and appends the listen port to the apache2_install[openstack]
|
||||
# resource which is defined in openstack-identity::server-apache.
|
||||
apache_resource = find_resource(:apache2_install, 'openstack')
|
||||
|
||||
if apache_resource
|
||||
apache_resource.listen = [apache_resource.listen, "#{bind_service['host']}:#{bind_service['port']}"].flatten
|
||||
else
|
||||
apache2_install 'openstack' do
|
||||
listen "#{bind_service['host']}:#{bind_service['port']}"
|
||||
end
|
||||
end
|
||||
|
||||
apache2_mod_wsgi 'openstack'
|
||||
apache2_module 'ssl' if node['openstack']['block-storage']['ssl']['enabled']
|
||||
|
||||
# remove the cinder-wsgi.conf automatically generated from package
|
||||
apache2_conf 'cinder-wsgi' do
|
||||
action :disable
|
||||
end
|
||||
|
||||
template "#{apache_dir}/sites-available/cinder-api.conf" do
|
||||
extend Apache2::Cookbook::Helpers
|
||||
source 'wsgi-template.conf.erb'
|
||||
variables(
|
||||
daemon_process: 'cinder-wsgi',
|
||||
server_host: bind_service['host'],
|
||||
server_port: bind_service['port'],
|
||||
server_entry: '/usr/bin/cinder-wsgi',
|
||||
log_dir: default_log_dir,
|
||||
run_dir: lock_dir,
|
||||
user: node['openstack']['block-storage']['user'],
|
||||
group: node['openstack']['block-storage']['group']
|
||||
)
|
||||
notifies :restart, 'service[apache2]'
|
||||
end
|
||||
|
||||
apache2_site 'cinder-api' do
|
||||
notifies :restart, 'service[apache2]', :immediately
|
||||
end
|
|
@ -1,39 +0,0 @@
|
|||
#
|
||||
# Cookbook:: openstack-block-storage
|
||||
# Recipe:: backup
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
include_recipe 'openstack-block-storage::cinder-common'
|
||||
|
||||
platform_options = node['openstack']['block-storage']['platform']
|
||||
|
||||
package platform_options['cinder_backup_packages'] do
|
||||
options platform_options['package_overrides']
|
||||
action :upgrade
|
||||
end
|
||||
|
||||
db_type = node['openstack']['db']['block_storage']['service_type']
|
||||
package node['openstack']['db']['python_packages'][db_type] do
|
||||
action :upgrade
|
||||
end
|
||||
|
||||
service 'cinder-backup' do
|
||||
service_name platform_options['cinder_backup_service']
|
||||
supports status: true, restart: true
|
||||
action [:enable, :start]
|
||||
subscribes :restart, 'template[/etc/cinder/cinder.conf]'
|
||||
end
|
|
@ -1,145 +0,0 @@
|
|||
#
|
||||
# Cookbook:: openstack-block-storage
|
||||
# Recipe:: cinder-common
|
||||
#
|
||||
# Copyright:: 2019-2021, 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
|
||||
#
|
||||
# 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.
|
||||
# Make Openstack object available in Chef::Recipe
|
||||
class ::Chef::Recipe
|
||||
include ::Openstack
|
||||
end
|
||||
|
||||
if node['openstack']['block-storage']['syslog']['use']
|
||||
include_recipe 'openstack-common::logging'
|
||||
end
|
||||
|
||||
platform_options = node['openstack']['block-storage']['platform']
|
||||
|
||||
package platform_options['cinder_common_packages'] do
|
||||
options platform_options['package_overrides']
|
||||
action :upgrade
|
||||
end
|
||||
|
||||
db_user = node['openstack']['db']['block_storage']['username']
|
||||
db_pass = get_password 'db', 'cinder'
|
||||
node.default['openstack']['block-storage']['conf_secrets']
|
||||
.[]('database')['connection'] =
|
||||
db_uri('block_storage', db_user, db_pass)
|
||||
|
||||
if node['openstack']['endpoints']['db']['enabled_slave']
|
||||
node.default['openstack']['block-storage']['conf_secrets']
|
||||
.[]('database')['slave_connection'] =
|
||||
db_uri('block_storage', db_user, db_pass, true)
|
||||
end
|
||||
|
||||
if node['openstack']['mq']['service_type'] == 'rabbit'
|
||||
node.default['openstack']['block-storage']['conf_secrets']['DEFAULT']['transport_url'] =
|
||||
rabbit_transport_url 'block_storage'
|
||||
end
|
||||
|
||||
glance_api_endpoint = internal_endpoint 'image_api'
|
||||
cinder_api_bind = node['openstack']['bind_service']['all']['block-storage']
|
||||
cinder_api_bind_address = bind_address cinder_api_bind
|
||||
identity_endpoint = internal_endpoint 'identity'
|
||||
node.default['openstack']['block-storage']['conf_secrets']
|
||||
.[]('keystone_authtoken')['password'] =
|
||||
get_password 'service', 'openstack-block-storage'
|
||||
|
||||
if node['openstack']['block-storage']['conf']['nova']['auth_type'] == 'password'
|
||||
node.default['openstack']['block-storage']['conf_secrets']
|
||||
.[]('nova')['password'] =
|
||||
get_password 'service', 'openstack-compute'
|
||||
end
|
||||
|
||||
auth_url = identity_endpoint.to_s
|
||||
|
||||
directory '/etc/cinder' do
|
||||
group node['openstack']['block-storage']['group']
|
||||
owner node['openstack']['block-storage']['user']
|
||||
mode '750'
|
||||
action :create
|
||||
end
|
||||
|
||||
node.default['openstack']['block-storage']['conf'].tap do |conf|
|
||||
conf['DEFAULT']['my_ip'] = cinder_api_bind_address
|
||||
conf['DEFAULT']['glance_api_servers'] = glance_api_endpoint.to_s
|
||||
conf['DEFAULT']['osapi_volume_listen'] = cinder_api_bind_address
|
||||
conf['DEFAULT']['osapi_volume_listen_port'] = cinder_api_bind['port']
|
||||
conf['keystone_authtoken']['auth_url'] = auth_url
|
||||
conf['nova']['auth_url'] = auth_url
|
||||
end
|
||||
|
||||
# Todo(jr): Make this configurable depending on backend to be used
|
||||
# This needs to be explicitly configured since Ocata
|
||||
node.default['openstack']['block-storage']['conf'].tap do |conf|
|
||||
conf['DEFAULT']['enabled_backends'] = 'lvm'
|
||||
conf['lvm']['volume_driver'] = 'cinder.volume.drivers.lvm.LVMVolumeDriver'
|
||||
conf['lvm']['volume_group'] = 'cinder-volumes'
|
||||
conf['lvm']['iscsi_protocol'] = 'iscsi'
|
||||
conf['lvm']['iscsi_helper'] = 'tgtadm'
|
||||
end
|
||||
|
||||
# merge all config options and secrets to be used in the cinder.conf.erb
|
||||
cinder_conf_options = merge_config_options 'block-storage'
|
||||
|
||||
# service['apache2'] is defined in the apache2_default_install resource
|
||||
# but other resources are currently unable to reference it. To work
|
||||
# around this issue, define the following helper in your cookbook:
|
||||
service 'apache2' do
|
||||
extend Apache2::Cookbook::Helpers
|
||||
service_name lazy { apache_platform_service_name }
|
||||
supports restart: true, status: true, reload: true
|
||||
action :nothing
|
||||
end
|
||||
|
||||
template '/etc/cinder/cinder.conf' do
|
||||
source 'openstack-service.conf.erb'
|
||||
cookbook 'openstack-common'
|
||||
group node['openstack']['block-storage']['group']
|
||||
owner node['openstack']['block-storage']['user']
|
||||
mode '640'
|
||||
sensitive true
|
||||
variables(
|
||||
service_config: cinder_conf_options
|
||||
)
|
||||
notifies :restart, 'service[apache2]'
|
||||
end
|
||||
|
||||
# delete all secrets saved in the attribute
|
||||
# node['openstack']['block-storage']['conf_secrets'] after creating the cinder.conf
|
||||
ruby_block "delete all attributes in node['openstack']['block-storage']['conf_secrets']" do
|
||||
block do
|
||||
node.rm(:openstack, :'block-storage', :conf_secrets)
|
||||
end
|
||||
end
|
||||
|
||||
directory node['openstack']['block-storage']['conf']['oslo_concurrency']['lock_path'] do
|
||||
group node['openstack']['block-storage']['group']
|
||||
owner node['openstack']['block-storage']['user']
|
||||
recursive true
|
||||
mode '755'
|
||||
end
|
||||
|
||||
if node['openstack']['block-storage']['use_rootwrap']
|
||||
template '/etc/cinder/rootwrap.conf' do
|
||||
source 'openstack-service.conf.erb'
|
||||
cookbook 'openstack-common'
|
||||
owner 'root'
|
||||
group 'root'
|
||||
mode '644'
|
||||
variables(
|
||||
service_config: node['openstack']['block-storage']['rootwrap']['conf']
|
||||
)
|
||||
end
|
||||
end
|
|
@ -1,103 +0,0 @@
|
|||
#
|
||||
# Cookbook:: openstack-block-storage
|
||||
# Recipe:: identity_registration
|
||||
#
|
||||
# Copyright:: 2012-2021, Rackspace US, Inc.
|
||||
# Copyright:: 2012-2021, AT&T Services, Inc.
|
||||
# Copyright:: 2013-2021, Chef Software, Inc.
|
||||
# Copyright:: 2019-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.
|
||||
#
|
||||
|
||||
# Make Openstack object available in Chef::Recipe
|
||||
class ::Chef::Recipe
|
||||
include ::Openstack
|
||||
end
|
||||
|
||||
identity_endpoint = internal_endpoint 'identity'
|
||||
auth_url = identity_endpoint.to_s
|
||||
|
||||
interfaces = {
|
||||
public: { url: public_endpoint('block-storage') },
|
||||
internal: { url: internal_endpoint('block-storage') },
|
||||
}
|
||||
service_pass = get_password 'service', 'openstack-block-storage'
|
||||
region = node['openstack']['block-storage']['region']
|
||||
service_project_name = node['openstack']['block-storage']['conf']['keystone_authtoken']['project_name']
|
||||
service_user = node['openstack']['block-storage']['service_user']
|
||||
admin_user = node['openstack']['identity']['admin_user']
|
||||
admin_pass = get_password 'user', node['openstack']['identity']['admin_user']
|
||||
admin_project = node['openstack']['identity']['admin_project']
|
||||
admin_domain = node['openstack']['identity']['admin_domain_name']
|
||||
service_domain_name = node['openstack']['block-storage']['conf']['keystone_authtoken']['user_domain_name']
|
||||
service_role = node['openstack']['block-storage']['service_role']
|
||||
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_project_name: admin_project,
|
||||
openstack_domain_name: admin_domain,
|
||||
}
|
||||
|
||||
# Register Volume Service
|
||||
openstack_service service_name do
|
||||
type service_type
|
||||
connection_params connection_params
|
||||
end
|
||||
|
||||
interfaces.each do |interface, res|
|
||||
# Register Volume Endpoints
|
||||
openstack_endpoint service_type do
|
||||
service_name service_name
|
||||
interface interface.to_s
|
||||
url res[:url].to_s
|
||||
region region
|
||||
connection_params connection_params
|
||||
end
|
||||
end
|
||||
|
||||
# Workaround to enable Volume support in Horizon
|
||||
# this may break in future releases of chef-client
|
||||
openstack_service 'cinderv3' do
|
||||
type 'volumev3'
|
||||
connection_params connection_params
|
||||
end
|
||||
|
||||
interfaces.each do |interface, res|
|
||||
openstack_endpoint 'volumev3' do
|
||||
service_name 'cinderv3'
|
||||
interface interface.to_s
|
||||
url res[:url].to_s.gsub('/v2', '/v3')
|
||||
region region
|
||||
connection_params connection_params
|
||||
end
|
||||
end
|
||||
|
||||
# Register Service Project
|
||||
openstack_project service_project_name do
|
||||
connection_params connection_params
|
||||
end
|
||||
|
||||
# Register Service User
|
||||
openstack_user service_user do
|
||||
project_name service_project_name
|
||||
domain_name service_domain_name
|
||||
role_name service_role
|
||||
password service_pass
|
||||
connection_params connection_params
|
||||
action [:create, :grant_role]
|
||||
end
|
|
@ -1,43 +0,0 @@
|
|||
#
|
||||
# Cookbook:: openstack-block-storage
|
||||
# Recipe:: scheduler
|
||||
#
|
||||
# Copyright:: 2012-2021, Rackspace US, Inc.
|
||||
# Copyright:: 2012-2021, AT&T Services, Inc.
|
||||
# Copyright:: 2013-2021, Chef Software, Inc.
|
||||
# Copyright:: 2013-2021, SUSE Linux Gmbh.
|
||||
# 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.
|
||||
#
|
||||
|
||||
include_recipe 'openstack-block-storage::cinder-common'
|
||||
|
||||
platform_options = node['openstack']['block-storage']['platform']
|
||||
|
||||
package platform_options['cinder_scheduler_packages'] do
|
||||
options platform_options['package_overrides']
|
||||
action :upgrade
|
||||
end
|
||||
|
||||
db_type = node['openstack']['db']['block_storage']['service_type']
|
||||
package node['openstack']['db']['python_packages'][db_type] do
|
||||
action :upgrade
|
||||
end
|
||||
|
||||
service 'cinder-scheduler' do
|
||||
service_name platform_options['cinder_scheduler_service']
|
||||
supports status: true, restart: true
|
||||
action [:enable, :start]
|
||||
subscribes :restart, 'template[/etc/cinder/cinder.conf]'
|
||||
end
|
|
@ -1,60 +0,0 @@
|
|||
#
|
||||
# Cookbook:: openstack-block-storage
|
||||
# Recipe:: volume
|
||||
#
|
||||
# Copyright:: 2012-2021, Rackspace US, Inc.
|
||||
# Copyright:: 2012-2021, AT&T Services, Inc.
|
||||
# Copyright:: 2013-2021, Chef Software, Inc.
|
||||
# Copyright:: 2013-2021, SUSE Linux Gmbh.
|
||||
# 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.
|
||||
#
|
||||
|
||||
# Chef
|
||||
class ::Chef::Recipe
|
||||
include ::Openstack
|
||||
end
|
||||
|
||||
include_recipe 'openstack-block-storage::cinder-common'
|
||||
|
||||
platform_options = node['openstack']['block-storage']['platform']
|
||||
|
||||
package platform_options['cinder_volume_packages'] do
|
||||
options platform_options['package_overrides']
|
||||
action :upgrade
|
||||
end
|
||||
|
||||
db_type = node['openstack']['db']['block_storage']['service_type']
|
||||
package node['openstack']['db']['python_packages'][db_type] do
|
||||
action :upgrade
|
||||
end
|
||||
|
||||
package platform_options['cinder_iscsitarget_packages'] do
|
||||
options platform_options['package_overrides']
|
||||
action :upgrade
|
||||
end
|
||||
|
||||
service 'cinder-volume' do
|
||||
service_name platform_options['cinder_volume_service']
|
||||
supports status: true, restart: true
|
||||
action [:enable, :start]
|
||||
subscribes :restart, 'template[/etc/cinder/cinder.conf]'
|
||||
end
|
||||
|
||||
service 'iscsitarget' do
|
||||
service_name platform_options['cinder_iscsitarget_service']
|
||||
supports status: true, restart: true
|
||||
action :enable
|
||||
end
|
|
@ -1,55 +0,0 @@
|
|||
#
|
||||
# Cookbook:: openstack-block-storage
|
||||
# Recipe:: volume_driver_lvm
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
platform_options = node['openstack']['block-storage']['platform']
|
||||
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
|
||||
# external cookbook for managing lvm stuff
|
||||
|
||||
vg_name = node['openstack']['block-storage']['conf']['DEFAULT']['volume_group']
|
||||
case node['openstack']['block-storage']['volume']['create_volume_group_type']
|
||||
when 'file'
|
||||
volume_size = node['openstack']['block-storage']['volume']['volume_group_size']
|
||||
seek_count = volume_size.to_i * 1024
|
||||
vg_file = "#{node['openstack']['block-storage']['conf']['DEFAULT']['state_path']}/#{vg_name}.img"
|
||||
|
||||
# create volume group
|
||||
execute 'Create Cinder loopback file' do
|
||||
command "dd if=/dev/zero of=#{vg_file} bs=1M seek=#{seek_count} count=0; vgcreate #{vg_name} $(losetup --show -f #{vg_file})"
|
||||
action :run
|
||||
not_if "pvs | grep -c #{vg_name}"
|
||||
end
|
||||
when 'block_devices'
|
||||
block_devices = node['openstack']['block-storage']['volume']['block_devices']
|
||||
|
||||
lvm_physical_volume block_devices do
|
||||
action :create
|
||||
not_if "pvs | grep -c #{block_devices}"
|
||||
end
|
||||
|
||||
lvm_volume_group vg_name do
|
||||
physical_volumes [block_devices]
|
||||
wipe_signatures true
|
||||
not_if "vgs #{vg_name}"
|
||||
end
|
||||
end
|
|
@ -1,35 +0,0 @@
|
|||
#
|
||||
# Cookbook:: openstack-block-storage
|
||||
|
||||
require_relative 'spec_helper'
|
||||
|
||||
describe 'openstack-block-storage::api' do
|
||||
ALL_RHEL.each do |p|
|
||||
context "redhat #{p[:version]}" do
|
||||
let(:runner) { ChefSpec::SoloRunner.new(p) }
|
||||
let(:node) { runner.node }
|
||||
cached(:chef_run) { runner.converge(described_recipe) }
|
||||
|
||||
include_context 'block-storage-stubs'
|
||||
|
||||
it do
|
||||
expect(chef_run).to_not create_file('/etc/apache2/conf-available/cinder-wsgi.conf')
|
||||
end
|
||||
|
||||
it do
|
||||
expect(chef_run).to upgrade_package %w(openstack-cinder)
|
||||
end
|
||||
|
||||
case p
|
||||
when REDHAT_7
|
||||
it 'upgrades mysql python package' do
|
||||
expect(chef_run).to upgrade_package 'MySQL-python'
|
||||
end
|
||||
when REDHAT_8
|
||||
it 'upgrades mysql python package' do
|
||||
expect(chef_run).to upgrade_package 'python3-PyMySQL'
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
168
spec/api_spec.rb
168
spec/api_spec.rb
|
@ -1,168 +0,0 @@
|
|||
#
|
||||
# Cookbook:: openstack-block-storage
|
||||
|
||||
require_relative 'spec_helper'
|
||||
|
||||
describe 'openstack-block-storage::api' do
|
||||
describe 'ubuntu' do
|
||||
let(:runner) { ChefSpec::SoloRunner.new(UBUNTU_OPTS) }
|
||||
let(:node) { runner.node }
|
||||
cached(:chef_run) { runner.converge(described_recipe) }
|
||||
|
||||
include_context 'block-storage-stubs'
|
||||
include_examples 'common-logging'
|
||||
include_examples 'creates_cinder_conf', 'service[apache2]', 'cinder', 'cinder', 'restart'
|
||||
|
||||
it do
|
||||
expect(chef_run).to create_file('/etc/apache2/conf-available/cinder-wsgi.conf').with(
|
||||
owner: 'root',
|
||||
group: 'www-data',
|
||||
mode: '0640',
|
||||
content: '# Chef openstack-block-storage: file to block config from package'
|
||||
)
|
||||
end
|
||||
|
||||
it do
|
||||
expect(chef_run).to upgrade_package %w(python3-cinder cinder-api)
|
||||
end
|
||||
|
||||
it 'upgrades mysql python3 package' do
|
||||
expect(chef_run).to upgrade_package('python3-mysqldb')
|
||||
end
|
||||
|
||||
it 'runs db migrations' do
|
||||
expect(chef_run).to run_execute('cinder-manage db sync').with(user: 'cinder', group: 'cinder')
|
||||
end
|
||||
|
||||
describe 'apache wsgi' do
|
||||
let(:file) { '/etc/apache2/sites-available/cinder-api.conf' }
|
||||
|
||||
it do
|
||||
expect(chef_run).to create_template(file).with(
|
||||
source: 'wsgi-template.conf.erb',
|
||||
variables: {
|
||||
daemon_process: 'cinder-wsgi',
|
||||
group: 'cinder',
|
||||
log_dir: '/var/log/apache2',
|
||||
run_dir: '/var/lock',
|
||||
server_entry: '/usr/bin/cinder-wsgi',
|
||||
server_host: '127.0.0.1',
|
||||
server_port: '8776',
|
||||
user: 'cinder',
|
||||
}
|
||||
)
|
||||
end
|
||||
it 'configures cinder-api.conf' do
|
||||
[
|
||||
/VirtualHost 127.0.0.1:8776/,
|
||||
/WSGIDaemonProcess cinder-wsgi processes=2 threads=10 user=cinder group=cinder display-name=%{GROUP}/,
|
||||
/WSGIProcessGroup cinder-wsgi/,
|
||||
%r{WSGIScriptAlias / /usr/bin/cinder-wsgi},
|
||||
%r{ErrorLog /var/log/apache2/cinder-wsgi_error.log},
|
||||
%r{CustomLog /var/log/apache2/cinder-wsgi_access.log combined},
|
||||
%r{WSGISocketPrefix /var/lock},
|
||||
].each do |line|
|
||||
expect(chef_run).to render_file(file).with_content(line)
|
||||
end
|
||||
expect(chef_run).to_not render_file(file).with_content(/SSLEngine On/)
|
||||
end
|
||||
it do
|
||||
expect(chef_run.template(file)).to notify('service[apache2]').to(:restart)
|
||||
end
|
||||
|
||||
it do
|
||||
expect(chef_run).to install_apache2_install('openstack').with(listen: %w(127.0.0.1:8776))
|
||||
end
|
||||
|
||||
it do
|
||||
expect(chef_run).to create_apache2_mod_wsgi('openstack')
|
||||
end
|
||||
|
||||
it do
|
||||
expect(chef_run).to_not enable_apache2_module('ssl')
|
||||
end
|
||||
|
||||
it do
|
||||
expect(chef_run).to disable_apache2_conf('cinder-wsgi')
|
||||
end
|
||||
|
||||
it do
|
||||
expect(chef_run).to enable_apache2_site('cinder-api')
|
||||
end
|
||||
|
||||
it do
|
||||
expect(chef_run.apache2_site('cinder-api')).to notify('service[apache2]').to(:restart).immediately
|
||||
end
|
||||
context 'Enable SSL' do
|
||||
cached(:chef_run) do
|
||||
node.override['openstack']['block-storage']['ssl']['enabled'] = true
|
||||
node.override['openstack']['block-storage']['ssl']['certfile'] = 'certfile'
|
||||
node.override['openstack']['block-storage']['ssl']['keyfile'] = 'keyfile'
|
||||
node.override['openstack']['block-storage']['ssl']['ca_certs_path'] = 'ca_certs_path'
|
||||
node.override['openstack']['block-storage']['ssl']['protocol'] = 'protocol'
|
||||
runner.converge(described_recipe)
|
||||
end
|
||||
it do
|
||||
expect(chef_run).to enable_apache2_module('ssl')
|
||||
end
|
||||
it 'configures cinder-api.conf' do
|
||||
[
|
||||
/SSLEngine On/,
|
||||
/SSLCertificateFile certfile/,
|
||||
/SSLCertificateKeyFile keyfile/,
|
||||
/SSLCACertificatePath ca_certs_path/,
|
||||
/SSLProtocol protocol/,
|
||||
].each do |line|
|
||||
expect(chef_run).to render_file(file).with_content(line)
|
||||
end
|
||||
[
|
||||
/SSLCertificateChainFile/,
|
||||
/SSLCipherSuite/,
|
||||
/SSLVerifyClient/,
|
||||
].each do |line|
|
||||
expect(chef_run).to_not render_file(file).with_content(line)
|
||||
end
|
||||
end
|
||||
context 'Enable chainfile, ciphers & cert_required' do
|
||||
cached(:chef_run) do
|
||||
node.override['openstack']['block-storage']['ssl']['enabled'] = true
|
||||
node.override['openstack']['block-storage']['ssl']['chainfile'] = 'chainfile'
|
||||
node.override['openstack']['block-storage']['ssl']['ciphers'] = 'ciphers'
|
||||
node.override['openstack']['block-storage']['ssl']['cert_required'] = true
|
||||
runner.converge(described_recipe)
|
||||
end
|
||||
it 'configures cinder-api.conf' do
|
||||
[
|
||||
/SSLCertificateChainFile chainfile/,
|
||||
/SSLCipherSuite ciphers/,
|
||||
/SSLVerifyClient require/,
|
||||
].each do |line|
|
||||
expect(chef_run).to render_file(file).with_content(line)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe 'policy file' do
|
||||
it 'does not manage policy file unless specified' do
|
||||
expect(chef_run).not_to create_remote_file('/etc/cinder/policy.json')
|
||||
end
|
||||
context 'policy file specified' do
|
||||
cached(:chef_run) do
|
||||
node.override['openstack']['block-storage']['policyfile_url'] = 'http://server/mypolicy.json'
|
||||
runner.converge(described_recipe)
|
||||
end
|
||||
let(:remote_policy) { chef_run.remote_file('/etc/cinder/policy.json') }
|
||||
|
||||
it 'manages policy file when remote file is specified' do
|
||||
expect(chef_run).to create_remote_file('/etc/cinder/policy.json').with(
|
||||
user: 'cinder',
|
||||
group: 'cinder',
|
||||
mode: '644'
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -1,41 +0,0 @@
|
|||
#
|
||||
# Cookbook:: openstack-block-storage
|
||||
|
||||
require_relative 'spec_helper'
|
||||
|
||||
describe 'openstack-block-storage::backup' do
|
||||
ALL_RHEL.each do |p|
|
||||
context "redhat #{p[:version]}" do
|
||||
let(:runner) { ChefSpec::SoloRunner.new(p) }
|
||||
let(:node) { runner.node }
|
||||
cached(:chef_run) { runner.converge(described_recipe) }
|
||||
|
||||
include_context 'block-storage-stubs'
|
||||
|
||||
describe 'enable cinder backup service' do
|
||||
before do
|
||||
node.override['openstack']['block-storage']['backup']['enabled'] = true
|
||||
end
|
||||
|
||||
it 'starts cinder backup' do
|
||||
expect(chef_run).to start_service 'openstack-cinder-backup'
|
||||
end
|
||||
|
||||
it 'starts cinder backup on boot' do
|
||||
expect(chef_run).to enable_service 'openstack-cinder-backup'
|
||||
end
|
||||
|
||||
case p
|
||||
when REDHAT_7
|
||||
it 'upgrades mysql python package' do
|
||||
expect(chef_run).to upgrade_package 'MySQL-python'
|
||||
end
|
||||
when REDHAT_8
|
||||
it 'upgrades mysql python package' do
|
||||
expect(chef_run).to upgrade_package 'python3-PyMySQL'
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -1,36 +0,0 @@
|
|||
#
|
||||
# Cookbook:: openstack-block-storage
|
||||
|
||||
require_relative 'spec_helper'
|
||||
|
||||
describe 'openstack-block-storage::backup' do
|
||||
describe 'ubuntu' do
|
||||
let(:runner) { ChefSpec::SoloRunner.new(UBUNTU_OPTS) }
|
||||
let(:node) { runner.node }
|
||||
cached(:chef_run) { runner.converge(described_recipe) }
|
||||
|
||||
include_context 'block-storage-stubs'
|
||||
|
||||
describe 'enable cinder backup service' do
|
||||
it do
|
||||
expect(chef_run).to upgrade_package %w(python3-cinder cinder-backup)
|
||||
end
|
||||
|
||||
it 'starts cinder backup' do
|
||||
expect(chef_run).to start_service 'cinder-backup'
|
||||
end
|
||||
|
||||
it 'starts cinder backup on boot' do
|
||||
expect(chef_run).to enable_service 'cinder-backup'
|
||||
end
|
||||
|
||||
it 'subscribes to the template change' do
|
||||
expect(chef_run.service('cinder-backup')).to subscribe_to('template[/etc/cinder/cinder.conf]')
|
||||
end
|
||||
|
||||
it 'upgrades mysql python3 package' do
|
||||
expect(chef_run).to upgrade_package 'python3-mysqldb'
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -1,20 +0,0 @@
|
|||
#
|
||||
# Cookbook:: openstack-block-storage
|
||||
|
||||
require_relative 'spec_helper'
|
||||
|
||||
describe 'openstack-block-storage::cinder-common' do
|
||||
ALL_RHEL.each do |p|
|
||||
context "redhat #{p[:version]}" do
|
||||
let(:runner) { ChefSpec::SoloRunner.new(p) }
|
||||
let(:node) { runner.node }
|
||||
cached(:chef_run) { runner.converge(described_recipe) }
|
||||
|
||||
include_context 'block-storage-stubs'
|
||||
|
||||
it 'upgrades the openstack-cinder package' do
|
||||
expect(chef_run).to upgrade_package 'openstack-cinder'
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -1,208 +0,0 @@
|
|||
#
|
||||
# Cookbook:: openstack-block-storage
|
||||
|
||||
require_relative 'spec_helper'
|
||||
|
||||
describe 'openstack-block-storage::cinder-common' do
|
||||
describe 'ubuntu' do
|
||||
let(:runner) { ChefSpec::SoloRunner.new(UBUNTU_OPTS) }
|
||||
let(:node) { runner.node }
|
||||
let(:test_pass) { 'test_pass' }
|
||||
cached(:chef_run) do
|
||||
node.override['openstack']['mq']['host'] = '127.0.0.1'
|
||||
node.override['openstack']['mq']['block-storage']['rabbit']['notification_topic'] = 'rabbit_topic'
|
||||
runner.converge(described_recipe)
|
||||
end
|
||||
|
||||
before do
|
||||
allow_any_instance_of(Chef::Recipe).to receive(:get_password)
|
||||
.with('user', anything)
|
||||
.and_return(test_pass)
|
||||
allow_any_instance_of(Chef::Recipe).to receive(:db_uri)
|
||||
.and_return('sql_connection_value')
|
||||
end
|
||||
|
||||
include_context 'block-storage-stubs'
|
||||
|
||||
it 'upgrades the cinder-common package' do
|
||||
expect(chef_run).to upgrade_package 'cinder-common'
|
||||
end
|
||||
|
||||
describe '/etc/cinder' do
|
||||
let(:dir) { chef_run.directory('/etc/cinder') }
|
||||
|
||||
it 'should create the /etc/cinder directory' do
|
||||
expect(chef_run).to create_directory(dir.name).with(
|
||||
owner: 'cinder',
|
||||
group: 'cinder',
|
||||
mode: '750'
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
describe 'cinder.conf' do
|
||||
let(:file) { chef_run.template('/etc/cinder/cinder.conf') }
|
||||
|
||||
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: '640',
|
||||
sensitive: true
|
||||
)
|
||||
end
|
||||
|
||||
describe 'keystone authtoken attributes with default values' do
|
||||
it 'does not set memcached server(s)' do
|
||||
expect(chef_run).not_to render_file(file.name).with_content(/^memcached_servers = $/)
|
||||
end
|
||||
|
||||
it 'does not set memcache security strategy' do
|
||||
expect(chef_run).not_to render_file(file.name).with_content(/^memcache_security_strategy = $/)
|
||||
end
|
||||
|
||||
it 'does not set memcache secret key' do
|
||||
expect(chef_run).not_to render_file(file.name).with_content(/^memcache_secret_key = $/)
|
||||
end
|
||||
|
||||
it 'does not set cafile' do
|
||||
expect(chef_run).not_to render_file(file.name).with_content(/^cafile = $/)
|
||||
end
|
||||
end
|
||||
|
||||
describe 'keystone authtoken attributes' do
|
||||
it do
|
||||
expect(chef_run).not_to render_file(file.name).with_content(/^auth_version = v2.0$/)
|
||||
end
|
||||
|
||||
it 'has an admin password' do
|
||||
# (fgimenez) the get_password mocking is set in spec/spec_helper.rb
|
||||
expect(chef_run).to render_config_file(file.name)
|
||||
.with_section_content('keystone_authtoken', /^password = cinder-pass$/)
|
||||
end
|
||||
end
|
||||
|
||||
describe 'template contents' do
|
||||
it 'has a lock_path attribute' do
|
||||
expect(chef_run).to render_config_file(file.name)
|
||||
.with_section_content('oslo_concurrency', %r{^lock_path = /var/lib/cinder/tmp})
|
||||
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
|
||||
|
||||
it 'does not have keymgr attribute fixed_key set by default' do
|
||||
expect(chef_run).not_to render_file(file.name).with_content(/^fixed_key = $/)
|
||||
end
|
||||
|
||||
context 'syslog use' do
|
||||
cached(:chef_run) do
|
||||
node.override['openstack']['block-storage']['syslog']['use'] = true
|
||||
runner.converge(described_recipe)
|
||||
end
|
||||
it 'sets the log_config value when syslog is in use' do
|
||||
expect(chef_run).to render_file(file.name).with_content(%r{^log_config = /etc/openstack/logging.conf$})
|
||||
end
|
||||
end
|
||||
|
||||
it 'has a db connection attribute' do
|
||||
expect(chef_run).to render_config_file(file.name)
|
||||
.with_section_content('database', /^connection = sql_connection_value$/)
|
||||
end
|
||||
|
||||
it 'has a glance_api_servers attribute' do
|
||||
expect(chef_run).to render_config_file(file.name)
|
||||
.with_section_content('DEFAULT', %r{^glance_api_servers = http://127.0.0.1:9292$})
|
||||
end
|
||||
|
||||
describe 'cinder endpoint' do
|
||||
it 'has osapi_volume_listen set' do
|
||||
expect(chef_run).to render_config_file(file.name)
|
||||
.with_section_content('DEFAULT', /^osapi_volume_listen = 127.0.0.1$/)
|
||||
end
|
||||
|
||||
it 'has osapi_volume_listen_port set' do
|
||||
expect(chef_run).to render_config_file(file.name)
|
||||
.with_section_content('DEFAULT', /^osapi_volume_listen_port = 8776$/)
|
||||
end
|
||||
end
|
||||
it 'has default transport_url/AMQP options set' do
|
||||
[
|
||||
%r{^transport_url = rabbit://guest:mypass@127.0.0.1:5672$},
|
||||
].each do |line|
|
||||
expect(chef_run).to render_config_file(file.name).with_section_content('DEFAULT', line)
|
||||
end
|
||||
end
|
||||
|
||||
describe 'rabbitmq as mq service' do
|
||||
describe 'non ha attributes' do
|
||||
it 'does not have a rabbit_hosts attribute' do
|
||||
expect(chef_run).not_to render_config_file(file.name)
|
||||
.with_section_content('oslo_messaging_rabbit', /^rabbit_hosts = /)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
context 'commonly named volume attributes' do
|
||||
vol_attrs = %w(iscsi_ip_address iscsi_port iscsi_helper volumes_dir)
|
||||
cached(:chef_run) do
|
||||
vol_attrs.each do |attr|
|
||||
node.override['openstack']['block-storage']['conf']['DEFAULT'][attr] = "common_volume_#{attr}_value"
|
||||
end
|
||||
runner.converge(described_recipe)
|
||||
end
|
||||
vol_attrs.each do |attr|
|
||||
it "has volume related #{attr} attribute" do
|
||||
expect(chef_run).to render_file(file.name).with_content(/^#{attr} = common_volume_#{attr}_value$/)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe '/var/lib/cinder/tmp' do
|
||||
let(:dir) { chef_run.directory('/var/lib/cinder/tmp') }
|
||||
|
||||
it 'should create the /var/lib/cinder/tmp directory' do
|
||||
expect(chef_run).to create_directory(dir.name).with(
|
||||
user: 'cinder',
|
||||
group: 'cinder',
|
||||
mode: '755'
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
describe 'rootwrap.conf' do
|
||||
let(:file) { chef_run.template('/etc/cinder/rootwrap.conf') }
|
||||
|
||||
it 'creates the /etc/cinder/rootwrap.conf file' do
|
||||
expect(chef_run).to create_template(file.name).with(
|
||||
user: 'root',
|
||||
group: 'root',
|
||||
mode: '644'
|
||||
)
|
||||
end
|
||||
|
||||
context 'template contents' do
|
||||
it 'sets the default attributes' do
|
||||
[
|
||||
%r{^filters_path = /etc/cinder/rootwrap.d,/usr/share/cinder/rootwrap$},
|
||||
%r{^exec_dirs = /sbin,/usr/sbin,/bin,/usr/bin$},
|
||||
/^use_syslog = false$/,
|
||||
/^syslog_log_facility = syslog$/,
|
||||
/^syslog_log_level = ERROR$/,
|
||||
].each do |line|
|
||||
expect(chef_run).to render_file(file.name).with_content(line)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
it do
|
||||
expect(chef_run).to run_ruby_block("delete all attributes in node['openstack']['block-storage']['conf_secrets']")
|
||||
end
|
||||
end
|
||||
end
|
|
@ -1,110 +0,0 @@
|
|||
#
|
||||
# Cookbook:: openstack-block-storage
|
||||
|
||||
require_relative 'spec_helper'
|
||||
|
||||
describe 'openstack-block-storage::identity_registration' do
|
||||
describe 'ubuntu' do
|
||||
let(:runner) { ChefSpec::SoloRunner.new(UBUNTU_OPTS) }
|
||||
let(:node) { runner.node }
|
||||
cached(:chef_run) { runner.converge(described_recipe) }
|
||||
|
||||
include_context 'block-storage-stubs'
|
||||
|
||||
connection_params = {
|
||||
openstack_auth_url: 'http://127.0.0.1:5000/v3',
|
||||
openstack_username: 'admin',
|
||||
openstack_api_key: 'emc_test_pass',
|
||||
openstack_project_name: 'admin',
|
||||
openstack_domain_name: 'default',
|
||||
}
|
||||
service_name = 'cinderv2'
|
||||
service_type = 'volumev2'
|
||||
service_user = 'cinder'
|
||||
url = 'http://127.0.0.1:8776/v2/%(tenant_id)s'
|
||||
url_v3 = 'http://127.0.0.1:8776/v3/%(tenant_id)s'
|
||||
region = 'RegionOne'
|
||||
project_name = 'service'
|
||||
role_name = 'service'
|
||||
password = 'cinder-pass'
|
||||
domain_name = 'Default'
|
||||
|
||||
it "registers #{project_name} Project" do
|
||||
expect(chef_run).to create_openstack_project(
|
||||
project_name
|
||||
).with(
|
||||
connection_params: connection_params
|
||||
)
|
||||
end
|
||||
|
||||
it "registers #{service_name} service" do
|
||||
expect(chef_run).to create_openstack_service(
|
||||
service_name
|
||||
).with(
|
||||
connection_params: connection_params,
|
||||
type: service_type
|
||||
)
|
||||
end
|
||||
|
||||
it 'registers cinderv3 service' do
|
||||
expect(chef_run).to create_openstack_service(
|
||||
'cinderv3'
|
||||
).with(
|
||||
connection_params: connection_params,
|
||||
type: 'volumev3'
|
||||
)
|
||||
end
|
||||
|
||||
context "registers #{service_name} endpoint" do
|
||||
%w(internal public).each do |interface|
|
||||
it "#{interface} endpoint with default values" do
|
||||
expect(chef_run).to create_openstack_endpoint(
|
||||
service_type
|
||||
).with(
|
||||
service_name: service_name,
|
||||
# interface: interface,
|
||||
url: url,
|
||||
region: region,
|
||||
connection_params: connection_params
|
||||
)
|
||||
end
|
||||
|
||||
it "volumev3 #{interface} endpoint with default values" do
|
||||
expect(chef_run).to create_openstack_endpoint(
|
||||
'volumev3'
|
||||
).with(
|
||||
service_name: 'cinderv3',
|
||||
# interface: interface,
|
||||
url: url_v3,
|
||||
region: region,
|
||||
connection_params: connection_params
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
context 'with custom region override' do
|
||||
cached(:chef_run) do
|
||||
node.override['openstack']['block-storage']['region'] = 'volumeRegion'
|
||||
runner.converge(described_recipe)
|
||||
end
|
||||
it do
|
||||
expect(chef_run).to create_openstack_endpoint(
|
||||
service_type
|
||||
).with(region: 'volumeRegion')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
it 'registers service user' do
|
||||
expect(chef_run).to create_openstack_user(
|
||||
service_user
|
||||
).with(
|
||||
domain_name: domain_name,
|
||||
project_name: project_name,
|
||||
role_name: role_name,
|
||||
password: password,
|
||||
connection_params: connection_params
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
|
@ -1,39 +0,0 @@
|
|||
#
|
||||
# Cookbook:: openstack-block-storage
|
||||
|
||||
require_relative 'spec_helper'
|
||||
|
||||
describe 'openstack-block-storage::scheduler' do
|
||||
ALL_RHEL.each do |p|
|
||||
context "redhat #{p[:version]}" do
|
||||
let(:runner) { ChefSpec::SoloRunner.new(p) }
|
||||
let(:node) { runner.node }
|
||||
cached(:chef_run) { runner.converge(described_recipe) }
|
||||
|
||||
include_context 'block-storage-stubs'
|
||||
|
||||
it 'upgrades cinder scheduler package' do
|
||||
expect(chef_run).to upgrade_package 'openstack-cinder'
|
||||
end
|
||||
|
||||
it 'starts cinder scheduler' do
|
||||
expect(chef_run).to start_service 'openstack-cinder-scheduler'
|
||||
end
|
||||
|
||||
it 'starts cinder scheduler on boot' do
|
||||
expect(chef_run).to enable_service 'openstack-cinder-scheduler'
|
||||
end
|
||||
|
||||
case p
|
||||
when REDHAT_7
|
||||
it 'upgrades mysql python package' do
|
||||
expect(chef_run).to upgrade_package 'MySQL-python'
|
||||
end
|
||||
when REDHAT_8
|
||||
it 'upgrades mysql python package' do
|
||||
expect(chef_run).to upgrade_package 'python3-PyMySQL'
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -1,32 +0,0 @@
|
|||
#
|
||||
# Cookbook:: openstack-block-storage
|
||||
|
||||
require_relative 'spec_helper'
|
||||
|
||||
describe 'openstack-block-storage::scheduler' do
|
||||
describe 'ubuntu' do
|
||||
let(:runner) { ChefSpec::SoloRunner.new(UBUNTU_OPTS) }
|
||||
let(:node) { runner.node }
|
||||
cached(:chef_run) { runner.converge(described_recipe) }
|
||||
|
||||
include_context 'block-storage-stubs'
|
||||
include_examples 'common-logging'
|
||||
include_examples 'creates_cinder_conf', 'service[cinder-scheduler]', 'cinder', 'cinder'
|
||||
|
||||
it do
|
||||
expect(chef_run).to upgrade_package %w(python3-cinder cinder-scheduler)
|
||||
end
|
||||
|
||||
it 'starts cinder scheduler' do
|
||||
expect(chef_run).to start_service 'cinder-scheduler'
|
||||
end
|
||||
|
||||
it 'starts cinder scheduler on boot' do
|
||||
expect(chef_run).to enable_service 'cinder-scheduler'
|
||||
end
|
||||
|
||||
it 'upgrades mysql python3 package' do
|
||||
expect(chef_run).to upgrade_package 'python3-mysqldb'
|
||||
end
|
||||
end
|
||||
end
|
|
@ -1,171 +0,0 @@
|
|||
#
|
||||
# Cookbook:: openstack-block-storage
|
||||
|
||||
require 'chefspec'
|
||||
require 'chefspec/berkshelf'
|
||||
require 'chef/application'
|
||||
|
||||
RSpec.configure do |config|
|
||||
config.color = true
|
||||
config.formatter = :documentation
|
||||
config.log_level = :warn
|
||||
config.file_cache_path = '/var/chef/cache'
|
||||
end
|
||||
|
||||
REDHAT_7 = {
|
||||
platform: 'redhat',
|
||||
version: '7',
|
||||
}.freeze
|
||||
|
||||
REDHAT_8 = {
|
||||
platform: 'redhat',
|
||||
version: '8',
|
||||
}.freeze
|
||||
|
||||
ALL_RHEL = [
|
||||
REDHAT_7,
|
||||
REDHAT_8,
|
||||
].freeze
|
||||
|
||||
UBUNTU_OPTS = {
|
||||
platform: 'ubuntu',
|
||||
version: '18.04',
|
||||
}.freeze
|
||||
|
||||
shared_context 'block-storage-stubs' do
|
||||
before do
|
||||
allow_any_instance_of(Chef::Recipe).to receive(:rabbit_servers)
|
||||
.and_return('1.1.1.1:5672,2.2.2.2:5672')
|
||||
allow_any_instance_of(Chef::Recipe).to receive(:get_password)
|
||||
.with('service', anything)
|
||||
.and_return('')
|
||||
allow_any_instance_of(Chef::Recipe).to receive(:get_password)
|
||||
.with('db', anything)
|
||||
.and_return('')
|
||||
allow_any_instance_of(Chef::Recipe).to receive(:get_password)
|
||||
.with('token', 'openstack_vmware_secret_name')
|
||||
.and_return 'vmware_secret_name'
|
||||
allow_any_instance_of(Chef::Recipe).to receive(:get_password)
|
||||
.with('user', 'guest')
|
||||
.and_return('mq-pass')
|
||||
allow_any_instance_of(Chef::Recipe).to receive(:get_password)
|
||||
.with('service', 'netapp')
|
||||
.and_return 'netapp-pass'
|
||||
allow_any_instance_of(Chef::Recipe).to receive(:get_password)
|
||||
.with('service', 'openstack-block-storage')
|
||||
.and_return('cinder-pass')
|
||||
allow_any_instance_of(Chef::Recipe).to receive(:get_password)
|
||||
.with('user', 'admin')
|
||||
.and_return('emc_test_pass')
|
||||
allow_any_instance_of(Chef::Recipe).to receive(:get_password)
|
||||
.with('user', 'ibmnas_admin')
|
||||
.and_return('test_pass')
|
||||
allow_any_instance_of(Chef::Recipe).to receive(:rabbit_transport_url)
|
||||
.with('block_storage')
|
||||
.and_return('rabbit://guest:mypass@127.0.0.1:5672')
|
||||
stub_command('/usr/sbin/httpd -t').and_return(true)
|
||||
stub_command('/usr/sbin/apache2 -t').and_return(true)
|
||||
allow(Chef::Application).to receive(:fatal!)
|
||||
# identity stubs
|
||||
allow_any_instance_of(Chef::Recipe).to receive(:secret)
|
||||
.with('secrets', 'credential_key0')
|
||||
.and_return('thisiscredentialkey0')
|
||||
allow_any_instance_of(Chef::Recipe).to receive(:secret)
|
||||
.with('secrets', 'credential_key1')
|
||||
.and_return('thisiscredentialkey1')
|
||||
allow_any_instance_of(Chef::Recipe).to receive(:secret)
|
||||
.with('secrets', 'fernet_key0')
|
||||
.and_return('thisisfernetkey0')
|
||||
allow_any_instance_of(Chef::Recipe).to receive(:secret)
|
||||
.with('secrets', 'fernet_key1')
|
||||
.and_return('thisisfernetkey1')
|
||||
allow_any_instance_of(Chef::Recipe).to receive(:search_for)
|
||||
.with('os-identity').and_return(
|
||||
[{
|
||||
'openstack' => {
|
||||
'identity' => {
|
||||
'admin_tenant_name' => 'admin',
|
||||
'admin_user' => 'admin',
|
||||
},
|
||||
},
|
||||
}]
|
||||
)
|
||||
allow_any_instance_of(Chef::Recipe).to receive(:memcached_servers)
|
||||
.and_return([])
|
||||
allow_any_instance_of(Chef::Recipe).to receive(:rabbit_transport_url)
|
||||
.with('identity')
|
||||
.and_return('rabbit://openstack:mypass@127.0.0.1:5672')
|
||||
end
|
||||
end
|
||||
|
||||
shared_examples 'common-logging' do
|
||||
context 'when syslog.use is true' do
|
||||
cached(:chef_run) do
|
||||
node.override['openstack']['block-storage']['syslog']['use'] = true
|
||||
runner.converge(described_recipe)
|
||||
end
|
||||
|
||||
it 'runs logging recipe if node attributes say to' do
|
||||
expect(chef_run).to include_recipe 'openstack-common::logging'
|
||||
end
|
||||
end
|
||||
|
||||
context 'when syslog.use is false' do
|
||||
cached(:chef_run) do
|
||||
node.override['openstack']['block-storage']['syslog']['use'] = false
|
||||
runner.converge(described_recipe)
|
||||
end
|
||||
|
||||
it 'runs logging recipe if node attributes say to' do
|
||||
expect(chef_run).to_not include_recipe 'openstack-common::logging'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def expect_runs_openstack_common_logging_recipe
|
||||
it 'runs logging recipe if node attributes say to' do
|
||||
expect(chef_run).to include_recipe 'openstack-common::logging'
|
||||
end
|
||||
end
|
||||
|
||||
shared_examples 'creates_cinder_conf' do |service, user, group, action = :restart|
|
||||
describe 'cinder.conf' do
|
||||
let(:file) { chef_run.template('/etc/cinder/cinder.conf') }
|
||||
|
||||
it 'creates the /etc/cinder/cinder.conf file' do
|
||||
expect(chef_run).to create_template(file.name).with(
|
||||
user: user,
|
||||
group: group,
|
||||
mode: '640'
|
||||
)
|
||||
end
|
||||
|
||||
it 'notifies service restart' do
|
||||
expect(file).to notify(service).to(action)
|
||||
end
|
||||
|
||||
it do
|
||||
[
|
||||
/^auth_type = password$/,
|
||||
/^region_name = RegionOne$/,
|
||||
/^username = cinder/,
|
||||
/^project_name = service$/,
|
||||
/^user_domain_name = Default/,
|
||||
/^project_domain_name = Default/,
|
||||
%r{^auth_url = http://127.0.0.1:5000/v3$},
|
||||
/^password = cinder-pass$/,
|
||||
].each do |line|
|
||||
expect(chef_run).to render_config_file(file.name)
|
||||
.with_section_content('keystone_authtoken', line)
|
||||
end
|
||||
end
|
||||
|
||||
it 'has oslo_messaging_notifications conf values' do
|
||||
[
|
||||
/^driver = cinder.openstack.common.notifier.rpc_notifier$/,
|
||||
].each do |line|
|
||||
expect(chef_run).to render_config_file(file.name).with_section_content('oslo_messaging_notifications', line)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -1,57 +0,0 @@
|
|||
#
|
||||
# Cookbook:: openstack-block-storage
|
||||
|
||||
require_relative 'spec_helper'
|
||||
|
||||
describe 'openstack-block-storage::volume' do
|
||||
ALL_RHEL.each do |p|
|
||||
context "redhat #{p[:version]}" do
|
||||
let(:runner) { ChefSpec::SoloRunner.new(p) }
|
||||
let(:node) { runner.node }
|
||||
cached(:chef_run) { runner.converge(described_recipe) }
|
||||
|
||||
include_context 'block-storage-stubs'
|
||||
|
||||
case p
|
||||
when REDHAT_7
|
||||
it do
|
||||
expect(chef_run).to upgrade_package('MySQL-python')
|
||||
end
|
||||
|
||||
it do
|
||||
expect(chef_run).to upgrade_package('qemu-img-ev')
|
||||
end
|
||||
|
||||
it do
|
||||
expect(chef_run).to upgrade_package %w(targetcli dbus-python)
|
||||
end
|
||||
when REDHAT_8
|
||||
it do
|
||||
expect(chef_run).to upgrade_package('python3-PyMySQL')
|
||||
end
|
||||
|
||||
it do
|
||||
expect(chef_run).to upgrade_package('qemu-img')
|
||||
end
|
||||
|
||||
it do
|
||||
expect(chef_run).to upgrade_package %w(targetcli python3-dbus)
|
||||
end
|
||||
end
|
||||
|
||||
it do
|
||||
expect(chef_run).to start_service('openstack-cinder-volume')
|
||||
end
|
||||
|
||||
it do
|
||||
expect(chef_run).to enable_service('openstack-cinder-volume')
|
||||
end
|
||||
|
||||
context 'ISCSI' do
|
||||
it do
|
||||
expect(chef_run).to enable_service('iscsitarget')
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -1,40 +0,0 @@
|
|||
#
|
||||
# Cookbook:: openstack-block-storage
|
||||
|
||||
require_relative 'spec_helper'
|
||||
|
||||
describe 'openstack-block-storage::volume' do
|
||||
describe 'ubuntu' do
|
||||
let(:runner) { ChefSpec::SoloRunner.new(UBUNTU_OPTS) }
|
||||
let(:node) { runner.node }
|
||||
cached(:chef_run) { runner.converge(described_recipe) }
|
||||
|
||||
include_context 'block-storage-stubs'
|
||||
include_examples 'common-logging'
|
||||
include_examples 'creates_cinder_conf', 'service[cinder-volume]', 'cinder', 'cinder'
|
||||
|
||||
it do
|
||||
expect(chef_run).to upgrade_package %w(python3-cinder cinder-volume qemu-utils thin-provisioning-tools)
|
||||
end
|
||||
|
||||
it 'starts cinder volume' do
|
||||
expect(chef_run).to start_service 'cinder-volume'
|
||||
end
|
||||
|
||||
it 'starts cinder volume on boot' do
|
||||
expect(chef_run).to enable_service 'cinder-volume'
|
||||
end
|
||||
|
||||
it 'starts iscsi target on boot' do
|
||||
expect(chef_run).to enable_service 'iscsitarget'
|
||||
end
|
||||
|
||||
it 'upgrades mysql python3 packages by default' do
|
||||
expect(chef_run).to upgrade_package 'python3-mysqldb'
|
||||
end
|
||||
|
||||
it 'upgrades cinder iscsi package' do
|
||||
expect(chef_run).to upgrade_package 'targetcli-fb'
|
||||
end
|
||||
end
|
||||
end
|
|
@ -1,12 +0,0 @@
|
|||
<%= node["openstack"]["block-storage"]["custom_template_banner"] %>
|
||||
<% @service_config.each do |section, values| -%>
|
||||
[<%= section %>]
|
||||
<% values.each do |key, value| -%>
|
||||
<% if value.class == Hash -%>
|
||||
<%= "# #{value['comment']}" -%>
|
||||
<%= key %> = <%= value['set_to'] %>
|
||||
<% else -%>
|
||||
<%= key %> = <%= value %>
|
||||
<% end -%>
|
||||
<% end -%>
|
||||
<% end -%>
|
|
@ -1,36 +0,0 @@
|
|||
<%= node["openstack"]["block-storage"]["custom_template_banner"] %>
|
||||
|
||||
<VirtualHost <%= @server_host %>:<%= @server_port %>>
|
||||
WSGIDaemonProcess <%= @daemon_process %> processes=2 threads=10 user=<%= @user %> group=<%= @group %> display-name=%{GROUP}
|
||||
WSGIProcessGroup <%= @daemon_process %>
|
||||
WSGIScriptAlias / <%= @server_entry %>
|
||||
WSGIApplicationGroup %{GLOBAL}
|
||||
WSGIPassAuthorization On
|
||||
|
||||
<Directory /usr/bin>
|
||||
Require all granted
|
||||
</Directory>
|
||||
|
||||
ErrorLogFormat "%{cu}t %M"
|
||||
ErrorLog <%= @log_dir %>/<%= @daemon_process %>_error.log
|
||||
CustomLog <%= @log_dir %>/<%= @daemon_process %>_access.log combined
|
||||
<% if node['openstack']['block-storage']['ssl']['enabled'] -%>
|
||||
|
||||
SSLEngine On
|
||||
SSLCertificateFile <%= node['openstack']['block-storage']['ssl']['certfile'] %>
|
||||
SSLCertificateKeyFile <%= node['openstack']['block-storage']['ssl']['keyfile'] %>
|
||||
SSLCACertificatePath <%= node['openstack']['block-storage']['ssl']['ca_certs_path'] %>
|
||||
<% unless node['openstack']['block-storage']['ssl']['chainfile'].empty? %>
|
||||
SSLCertificateChainFile <%= node['openstack']['block-storage']['ssl']['chainfile'] %>
|
||||
<% end -%>
|
||||
SSLProtocol <%= node['openstack']['block-storage']['ssl']['protocol'] %>
|
||||
<% unless node['openstack']['block-storage']['ssl']['ciphers'].empty? -%>
|
||||
SSLCipherSuite <%= node['openstack']['block-storage']['ssl']['ciphers'] %>
|
||||
<% end -%>
|
||||
<% if node['openstack']['block-storage']['ssl']['cert_required'] -%>
|
||||
SSLVerifyClient require
|
||||
<% end -%>
|
||||
<% end -%>
|
||||
</VirtualHost>
|
||||
|
||||
WSGISocketPrefix <%= @run_dir -%>
|
Loading…
Reference in New Issue