diff --git a/.delivery/project.toml b/.delivery/project.toml deleted file mode 100644 index 4066e55..0000000 --- a/.delivery/project.toml +++ /dev/null @@ -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" diff --git a/.gitignore b/.gitignore deleted file mode 100644 index d7ee44a..0000000 --- a/.gitignore +++ /dev/null @@ -1,9 +0,0 @@ -.bundle/ -berks-cookbooks/ -.kitchen -.vagrant -.coverage/ -*.swp -Berksfile.lock -Vagrantfile -Gemfile.lock diff --git a/.rubocop.yml b/.rubocop.yml deleted file mode 100644 index 389f270..0000000 --- a/.rubocop.yml +++ /dev/null @@ -1,4 +0,0 @@ -Chef/Modernize/FoodcriticComments: - Enabled: true -Chef/Style/CopyrightCommentFormat: - Enabled: true diff --git a/.zuul.yaml b/.zuul.yaml deleted file mode 100644 index f578684..0000000 --- a/.zuul.yaml +++ /dev/null @@ -1,3 +0,0 @@ -- project: - templates: - - openstack-chef-jobs diff --git a/Berksfile b/Berksfile deleted file mode 100644 index f9254a8..0000000 --- a/Berksfile +++ /dev/null @@ -1,24 +0,0 @@ -source 'https://supermarket.chef.io' - -solver :ruby, :required - -[ - %w(client dep), - %w(-common dep), - %w(-compute integration), - %w(-dns integration), - %w(-identity dep), - %w(-image integration), - %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 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index e79f185..0000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -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: - - https://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: - - https://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 diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 68c771a..0000000 --- a/LICENSE +++ /dev/null @@ -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. - diff --git a/README.rst b/README.rst index 447b01e..4ee2c5f 100644 --- a/README.rst +++ b/README.rst @@ -1,125 +1,10 @@ -OpenStack Chef Cookbook - orchestration -======================================= +This project is no longer maintained. -.. image:: https://governance.openstack.org/badges/cookbook-openstack-orchestration.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 -=========== - -This cookbook installs the OpenStack Heat service **Heat** as part of an -OpenStack reference deployment Chef for OpenStack. The `OpenStack -chef-repo`_ contains documentation for using this cookbook in the -context of a full OpenStack deployment. Heat is currently installed from -packages. - -.. _OpenStack chef-repo: https://opendev.org/openstack/openstack-chef - -https://docs.openstack.org/heat/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: - -- 'openstack-common', '>= 20.0.0' -- 'openstack-identity', '>= 20.0.0' -- 'openstackclient' - -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 ``heat.conf`` is described in -the openstack-common cookbook. - -Recipes -======= - -openstack-orchestration::api-cfn --------------------------------- - -- Configure and start ``heat-api-cfn`` service - -openstack-orchestration::api ----------------------------- - -- Configure and start ``heat-api`` service - -openstack-orchestration::common -------------------------------- - -- Installs the ``heat`` packages and setup configuration for Heat. - -openstack-orchestration::engine -------------------------------- - -- Setup the heat database and start ``heat-engine`` service - -openstack-orchestration::identity_registration ----------------------------------------------- - -- Registers the Heat API endpoint, heat service and user - -License and Author -================== - -+-----------------+---------------------------------------------+ -| **Author** | Zhao Fang Han (hanzhf@cn.ibm.com) | -+-----------------+---------------------------------------------+ -| **Author** | Chen Zhiwei (zhiwchen@cn.ibm.com) | -+-----------------+---------------------------------------------+ -| **Author** | Ionut Artarisi (iartarisi@suse.cz) | -+-----------------+---------------------------------------------+ -| **Author** | Mark Vanderwiel (vanderwl@us.ibm.com) | -+-----------------+---------------------------------------------+ -| **Author** | Jan Klare (j.klare@x-ion.de) | -+-----------------+---------------------------------------------+ -| **Author** | Dr. Jens Rosenboom (j.rosenboom@x-ion.de) | -+-----------------+---------------------------------------------+ -| **Author** | Christoph Albers (c.albers@x-ion.de) | -+-----------------+---------------------------------------------+ -| **Author** | Lance Albertson (lance@osuosl.org) | -+-----------------+---------------------------------------------+ - -+-----------------+--------------------------------------------------+ -| **Copyright** | Copyright (c) 2013-2014, IBM Corp. | -+-----------------+--------------------------------------------------+ -| **Copyright** | Copyright (c) 2014, SUSE Linux, GmbH. | -+-----------------+--------------------------------------------------+ -| **Copyright** | Copyright (c) 2016, x-ion GmbH. | -+-----------------+--------------------------------------------------+ -| **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 - -:: - - https://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. diff --git a/Rakefile b/Rakefile deleted file mode 100644 index 6ec521b..0000000 --- a/Rakefile +++ /dev/null @@ -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 diff --git a/TESTING.md b/TESTING.md deleted file mode 100644 index 328cc4b..0000000 --- a/TESTING.md +++ /dev/null @@ -1,31 +0,0 @@ -# Testing the Cookbook # - -This cookbook uses [chefdk](https://downloads.chef.io/chef-dk/) and [berkshelf](https://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](https://acrmp.github.io/foodcritic/) is a lint tool for Chef cookbooks. We ignore the following rules: - -* [FC003](https://acrmp.github.io/foodcritic/#FC003) These cookbooks are not intended for Chef Solo. -* [FC023](https://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. - diff --git a/attributes/default.rb b/attributes/default.rb deleted file mode 100644 index 48186b5..0000000 --- a/attributes/default.rb +++ /dev/null @@ -1,89 +0,0 @@ -# -# Cookbook:: openstack-orchestration -# Attributes:: default -# -# Copyright:: 2013-2021, IBM Corp. -# 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. -# - -%w(public internal).each do |ep_type| - # openstack orchestration-api service endpoints (used by users and services) - default['openstack']['endpoints'][ep_type]['orchestration-api']['host'] = '127.0.0.1' - default['openstack']['endpoints'][ep_type]['orchestration-api']['scheme'] = 'http' - default['openstack']['endpoints'][ep_type]['orchestration-api']['path'] = '/v1/%(tenant_id)s' - default['openstack']['endpoints'][ep_type]['orchestration-api']['port'] = 8004 - # openstack orchestration-api-cfn service endpoints (used by users and services) - default['openstack']['endpoints'][ep_type]['orchestration-api-cfn']['host'] = '127.0.0.1' - default['openstack']['endpoints'][ep_type]['orchestration-api-cfn']['scheme'] = 'http' - default['openstack']['endpoints'][ep_type]['orchestration-api-cfn']['path'] = '/v1' - default['openstack']['endpoints'][ep_type]['orchestration-api-cfn']['port'] = 8000 -end -default['openstack']['bind_service']['all']['orchestration-api']['host'] = '127.0.0.1' -default['openstack']['bind_service']['all']['orchestration-api']['port'] = 8004 -default['openstack']['bind_service']['all']['orchestration-api-cfn']['host'] = '127.0.0.1' -default['openstack']['bind_service']['all']['orchestration-api-cfn']['port'] = 8000 - -# 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']['orchestration']['custom_template_banner'] = ' -# This file is automatically generated by Chef -# Any changes will be overwritten -' - -default['openstack']['orchestration']['syslog']['use'] - -# This is the name of the Chef role that will install the Keystone Service API -default['openstack']['orchestration']['identity_service_chef_role'] = 'os-identity' - -# The name of the Chef role that knows about the message queue server -# that Heat uses -default['openstack']['orchestration']['rabbit_server_chef_role'] = 'os-ops-messaging' - -default['openstack']['orchestration']['service_role'] = 'service' - -default['openstack']['orchestration']['ec2authtoken']['auth']['version'] = 'v2.0' - -# platform-specific settings -case node['platform_family'] -when 'rhel' - default['openstack']['orchestration']['user'] = 'heat' - default['openstack']['orchestration']['group'] = 'heat' - default['openstack']['orchestration']['platform'] = { - 'heat_common_packages' => %w(openstack-heat-common), - 'heat_api_packages' => %w(openstack-heat-api), - 'heat_dashboard_packages' => %w(openstack-heat-ui), - 'heat_api_service' => 'openstack-heat-api', - 'heat_api_cfn_packages' => %w(openstack-heat-api-cfn), - 'heat_api_cfn_service' => 'openstack-heat-api-cfn', - 'heat_engine_packages' => %w(openstack-heat-engine), - 'heat_engine_service' => 'openstack-heat-engine', - 'heat_api_process_name' => 'heat-api', - 'package_overrides' => '', - } -when 'debian' - default['openstack']['orchestration']['user'] = 'heat' - default['openstack']['orchestration']['group'] = 'heat' - default['openstack']['orchestration']['platform'] = { - 'heat_common_packages' => %w(heat-common python3-heat), - 'heat_api_packages' => %w(heat-api), - 'heat_dashboard_packages' => %w(python3-heat-dashboard), - 'heat_api_service' => 'heat-api', - 'heat_api_cfn_packages' => %w(heat-api-cfn), - 'heat_api_cfn_service' => 'heat-api-cfn', - 'heat_engine_packages' => %w(heat-engine), - 'heat_engine_service' => 'heat-engine', - 'package_overrides' => '', - } -end diff --git a/attributes/heat_conf.rb b/attributes/heat_conf.rb deleted file mode 100644 index eaaa239..0000000 --- a/attributes/heat_conf.rb +++ /dev/null @@ -1,34 +0,0 @@ -# -# Cookbook:: openstack-orchestration -# Attributes:: default -# -# 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. -# - -default['openstack']['orchestration']['conf']['DEFAULT']['log_dir'] = '/var/log/heat' -default['openstack']['orchestration']['conf']['DEFAULT']['stack_domain_admin'] = 'heat_domain_admin' -default['openstack']['orchestration']['conf']['DEFAULT']['stack_user_domain_name'] = 'heat' -default['openstack']['orchestration']['conf']['oslo_messaging_notifications']['driver'] = - 'heat.openstack.common.notifier.rpc_notifier' -default['openstack']['orchestration']['conf']['keystone_authtoken']['auth_type'] = 'v3password' -default['openstack']['orchestration']['conf']['keystone_authtoken']['username'] = 'heat' -default['openstack']['orchestration']['conf']['keystone_authtoken']['project_name'] = 'service' -default['openstack']['orchestration']['conf']['keystone_authtoken']['project_domain_name'] = 'Default' -default['openstack']['orchestration']['conf']['keystone_authtoken']['user_domain_name'] = 'Default' -default['openstack']['orchestration']['conf']['trustee']['auth_type'] = 'v3password' -default['openstack']['orchestration']['conf']['trustee']['username'] = 'heat' -default['openstack']['orchestration']['conf']['trustee']['user_domain_name'] = - node['openstack']['orchestration']['conf']['keystone_authtoken']['user_domain_name'] diff --git a/metadata.rb b/metadata.rb deleted file mode 100644 index 23cdf85..0000000 --- a/metadata.rb +++ /dev/null @@ -1,18 +0,0 @@ -name 'openstack-orchestration' -maintainer 'openstack-chef' -maintainer_email 'openstack-discuss@lists.openstack.org' -license 'Apache-2.0' -description 'Installs and configures the Heat Service' -version '20.0.0' - -%w(ubuntu redhat centos).each do |os| - supports os -end - -depends 'openstackclient' -depends 'openstack-common', '>= 20.0.0' -depends 'openstack-identity', '>= 20.0.0' - -issues_url 'https://launchpad.net/openstack-chef' -source_url 'https://opendev.org/openstack/cookbook-openstack-orchestration' -chef_version '>= 16.0' diff --git a/recipes/api-cfn.rb b/recipes/api-cfn.rb deleted file mode 100644 index badf0ee..0000000 --- a/recipes/api-cfn.rb +++ /dev/null @@ -1,36 +0,0 @@ -# -# Cookbook:: openstack-orchestration -# Recipe:: api-cfn -# -# Copyright:: 2013-2021, IBM Corp. -# 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. -# - -include_recipe 'openstack-orchestration::common' - -platform_options = node['openstack']['orchestration']['platform'] - -package platform_options['heat_api_cfn_packages'] do - options platform_options['package_overrides'] - action :upgrade -end - -service 'heat-api-cfn' do - service_name platform_options['heat_api_cfn_service'] - supports status: true, restart: true - - action [:enable, :start] - subscribes :restart, 'template[/etc/heat/heat.conf]' -end diff --git a/recipes/api.rb b/recipes/api.rb deleted file mode 100644 index 27b40c9..0000000 --- a/recipes/api.rb +++ /dev/null @@ -1,35 +0,0 @@ -# -# Cookbook:: openstack-orchestration -# Recipe:: api -# -# Copyright:: 2013-2021, IBM Corp. -# 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. -# - -include_recipe 'openstack-orchestration::common' - -platform_options = node['openstack']['orchestration']['platform'] - -package platform_options['heat_api_packages'] do - options platform_options['package_overrides'] - action :upgrade -end - -service 'heat-api' do - service_name platform_options['heat_api_service'] - supports status: true, restart: true - action [:enable, :start] - subscribes :restart, 'template[/etc/heat/heat.conf]' -end diff --git a/recipes/common.rb b/recipes/common.rb deleted file mode 100644 index 7301f89..0000000 --- a/recipes/common.rb +++ /dev/null @@ -1,132 +0,0 @@ -# -# Cookbook:: openstack-orchestration -# Recipe:: engine -# -# Copyright:: 2013-2021, IBM Corp. -# Copyright:: 2014-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. -# - -class ::Chef::Recipe - include ::Openstack -end - -if node['openstack']['orchestration']['syslog']['use'] - include_recipe 'openstack-common::logging' -end - -platform_options = node['openstack']['orchestration']['platform'] - -package platform_options['heat_common_packages'] do - options platform_options['package_overrides'] - action :upgrade -end - -db_type = node['openstack']['db']['orchestration']['service_type'] -package node['openstack']['db']['python_packages'][db_type] do - action :upgrade -end - -if node['openstack']['mq']['service_type'] == 'rabbit' - node.default['openstack']['orchestration']['conf_secrets']['DEFAULT']['transport_url'] = - rabbit_transport_url 'orchestration' -end - -db_user = node['openstack']['db']['orchestration']['username'] -db_pass = get_password 'db', 'heat' -stack_domain_admin = node['openstack']['orchestration']['conf']['DEFAULT']['stack_domain_admin'] - -identity_endpoint = public_endpoint 'identity' - -bind_services = node['openstack']['bind_service']['all'] -api_bind = bind_services['orchestration-api'] -api_cfn_bind = bind_services['orchestration-api-cfn'] -api_cfn_endpoint = internal_endpoint 'orchestration-api-cfn' - -ec2_auth_uri = identity_endpoint.to_s -auth_uri = identity_endpoint.to_s -base_auth_uri = public_endpoint 'identity' -base_auth_uri.path = '/' - -# We need these URIs without their default path -metadata_uri = "#{api_cfn_endpoint.scheme}://#{api_cfn_endpoint.host}:#{api_cfn_endpoint.port}" - -# define attributes that are needed in the heat.conf -node.default['openstack']['orchestration']['conf'].tap do |conf| - conf['DEFAULT']['heat_metadata_server_url'] = metadata_uri - conf['DEFAULT']['heat_waitcondition_server_url'] = "#{api_cfn_endpoint}/waitcondition" - conf['DEFAULT']['region_name_for_services'] = node['openstack']['region'] - conf['clients_keystone']['auth_uri'] = base_auth_uri.to_s - conf['ec2authtoken']['auth_uri'] = ec2_auth_uri - conf['heat_api']['bind_host'] = bind_address api_bind - conf['heat_api']['bind_port'] = api_bind['port'] - conf['heat_api_cfn']['bind_host'] = bind_address api_cfn_bind - conf['heat_api_cfn']['bind_port'] = api_cfn_bind['port'] - conf['keystone_authtoken']['auth_url'] = auth_uri - conf['trustee']['auth_url'] = identity_endpoint -end - -# define secrets that are needed in the heat.conf -node.default['openstack']['orchestration']['conf_secrets'].tap do |conf_secrets| - conf_secrets['DEFAULT']['auth_encryption_key'] = - get_password 'token', 'orchestration_auth_encryption_key' - conf_secrets['database']['connection'] = - db_uri('orchestration', db_user, db_pass) - conf_secrets['keystone_authtoken']['password'] = - get_password 'service', 'openstack-orchestration' - conf_secrets['trustee']['password'] = - get_password 'service', 'openstack-orchestration' - conf_secrets['DEFAULT']['stack_domain_admin_password'] = - get_password 'user', stack_domain_admin -end - -# merge all config options and secrets to be used in the heat.conf -heat_conf_options = merge_config_options 'orchestration' - -directory '/etc/heat' do - owner node['openstack']['orchestration']['user'] - group node['openstack']['orchestration']['group'] - mode '750' -end - -directory '/etc/heat/environment.d' do - owner node['openstack']['orchestration']['user'] - group node['openstack']['orchestration']['group'] - mode '750' -end - -template '/etc/heat/heat.conf' do - source 'openstack-service.conf.erb' - cookbook 'openstack-common' - owner node['openstack']['orchestration']['user'] - group node['openstack']['orchestration']['group'] - mode '640' - sensitive true - variables( - service_config: heat_conf_options - ) -end - -template '/etc/heat/environment.d/default.yaml' do - source 'default.yaml.erb' - owner node['openstack']['orchestration']['user'] - group node['openstack']['orchestration']['group'] - mode '644' -end - -execute 'heat-manage db_sync' do - user node['openstack']['orchestration']['user'] - group node['openstack']['orchestration']['group'] -end diff --git a/recipes/dashboard.rb b/recipes/dashboard.rb deleted file mode 100644 index 67d2fab..0000000 --- a/recipes/dashboard.rb +++ /dev/null @@ -1,30 +0,0 @@ -# -# Cookbook:: openstack-orchestration -# Recipe:: dashboard -# -# Copyright:: 2018-2021, x-ion 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. -# - -class ::Chef::Recipe - include ::Openstack -end - -platform_options = node['openstack']['orchestration']['platform'] - -package platform_options['heat_dashboard_packages'] do - options platform_options['package_overrides'] - action :upgrade -end diff --git a/recipes/engine.rb b/recipes/engine.rb deleted file mode 100644 index 3714ced..0000000 --- a/recipes/engine.rb +++ /dev/null @@ -1,35 +0,0 @@ -# -# Cookbook:: openstack-orchestration -# Recipe:: engine -# -# Copyright:: 2013-2021, IBM Corp. -# 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. -# - -include_recipe 'openstack-orchestration::common' - -platform_options = node['openstack']['orchestration']['platform'] - -package platform_options['heat_engine_packages'] do - options platform_options['package_overrides'] - action :upgrade -end - -service 'heat_engine' do - service_name platform_options['heat_engine_service'] - supports status: true, restart: true - action [:enable, :start] - subscribes :restart, 'template[/etc/heat/heat.conf]' -end diff --git a/recipes/identity_registration.rb b/recipes/identity_registration.rb deleted file mode 100644 index 83e0a9e..0000000 --- a/recipes/identity_registration.rb +++ /dev/null @@ -1,165 +0,0 @@ -# -# Cookbook:: openstack-orchestration -# Recipe:: identity_registration -# -# Copyright:: 2013-2021, IBM Corp. -# 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. -# - -class ::Chef::Recipe - include ::Openstack -end - -identity_endpoint = public_endpoint 'identity' -auth_url = identity_endpoint.to_s - -internal_heat_endpoint = internal_endpoint 'orchestration-api' -public_heat_endpoint = public_endpoint 'orchestration-api' -internal_heat_cfn_endpoint = internal_endpoint 'orchestration-api-cfn' -public_heat_cfn_endpoint = public_endpoint 'orchestration-api-cfn' -stack_domain_admin = node['openstack']['orchestration']['conf']['DEFAULT']['stack_domain_admin'] -stack_domain_admin_password = get_password 'user', stack_domain_admin -service_pass = get_password 'service', 'openstack-orchestration' -service_project_name = node['openstack']['orchestration']['conf']['keystone_authtoken']['project_name'] -service_user = node['openstack']['orchestration']['conf']['keystone_authtoken']['username'] -service_role = node['openstack']['orchestration']['service_role'] -service_type = 'orchestration' -service_name = 'heat' -service_domain_name = node['openstack']['orchestration']['conf']['keystone_authtoken']['user_domain_name'] -heat_domain_name = node['openstack']['orchestration']['conf']['DEFAULT']['stack_user_domain_name'] -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'] -region = node['openstack']['region'] - -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, -} - -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -# Create Orchestration service, endpoints - -# Register Orchestration Service -openstack_service service_name do - type service_type - connection_params connection_params -end - -# Register Orchestration Public-Endpoint -openstack_endpoint service_type do - service_name service_name - interface 'public' - url public_heat_endpoint.to_s - region region - connection_params connection_params -end - -# Register Orchestration Internal-Endpoint -openstack_endpoint service_type do - service_name service_name - interface 'internal' - url internal_heat_endpoint.to_s - region region - connection_params connection_params -end - -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -# Create heat project, heat user - -# Register Service Tenant -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 - password service_pass - connection_params connection_params -end - -## Grant Service role to Service User for Service Tenant ## -openstack_user service_user do - role_name service_role - project_name service_project_name - connection_params connection_params - action :grant_role -end - -# TODO: (MRV) Revert this change until a better solution can be found -# Bug: #1309123 reverts 1279577 -# if node.run_list.include?('openstack-orchestration::api-cfn') - -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -# Create Cloudformation service, endpoints - -# Register Heat API Cloudformation Service -openstack_service 'heat-cfn' do - type 'cloudformation' - connection_params connection_params -end - -# Register Heat API CloudFormation Public-Endpoint -openstack_endpoint 'cloudformation' do - service_name 'heat-cfn' - interface 'public' - url public_heat_cfn_endpoint.to_s - region region - connection_params connection_params -end - -# Register Heat API CloudFormation Internal-Endpoint -openstack_endpoint 'cloudformation' do - service_name 'heat-cfn' - interface 'internal' - url internal_heat_cfn_endpoint.to_s - region region - connection_params connection_params -end -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -# Create heat domain, heat_domain_admin user - -openstack_domain heat_domain_name do - connection_params connection_params -end - -# Create heat_domain_admin in domain heat -openstack_user stack_domain_admin do - domain_name heat_domain_name - password stack_domain_admin_password - connection_params connection_params -end - -# Grant role to heat_domain_admin in domain heat -openstack_user stack_domain_admin do - domain_name heat_domain_name - role_name 'admin' - connection_params connection_params - action :grant_domain -end -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -openstack_role 'heat_stack_owner' do - connection_params connection_params -end - -openstack_role 'heat_stack_user' do - connection_params connection_params -end diff --git a/spec/api-cfn-redhat_spec.rb b/spec/api-cfn-redhat_spec.rb deleted file mode 100644 index 0eff088..0000000 --- a/spec/api-cfn-redhat_spec.rb +++ /dev/null @@ -1,26 +0,0 @@ -require_relative 'spec_helper' - -describe 'openstack-orchestration::api-cfn' 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 'orchestration_stubs' - include_examples 'expect runs openstack orchestration common recipe' - - it 'installs heat cfn packages' do - expect(chef_run).to upgrade_package 'openstack-heat-api-cfn' - end - - it 'enables heat api-cfn on boot' do - expect(chef_run).to enable_service('openstack-heat-api-cfn') - end - - it 'starts heat api-cfn on boot' do - expect(chef_run).to start_service('openstack-heat-api-cfn') - end - end - end -end diff --git a/spec/api-cfn_spec.rb b/spec/api-cfn_spec.rb deleted file mode 100644 index 4f5cef3..0000000 --- a/spec/api-cfn_spec.rb +++ /dev/null @@ -1,24 +0,0 @@ -require_relative 'spec_helper' - -describe 'openstack-orchestration::api-cfn' do - describe 'ubuntu' do - let(:runner) { ChefSpec::SoloRunner.new(UBUNTU_OPTS) } - let(:node) { runner.node } - cached(:chef_run) { runner.converge(described_recipe) } - - include_context 'orchestration_stubs' - include_examples 'expect runs openstack orchestration common recipe' - - it 'installs heat cfn packages' do - expect(chef_run).to upgrade_package 'heat-api-cfn' - end - - it 'enables heat api-cfn on boot' do - expect(chef_run).to enable_service('heat-api-cfn') - end - - it 'starts heat api-cfn on boot' do - expect(chef_run).to start_service('heat-api-cfn') - end - end -end diff --git a/spec/api-redhat_spec.rb b/spec/api-redhat_spec.rb deleted file mode 100644 index aa953d2..0000000 --- a/spec/api-redhat_spec.rb +++ /dev/null @@ -1,26 +0,0 @@ -require_relative 'spec_helper' - -describe 'openstack-orchestration::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 'orchestration_stubs' - include_examples 'expect runs openstack orchestration common recipe' - - it 'installs heat api packages' do - expect(chef_run).to upgrade_package 'openstack-heat-api' - end - - it 'enables heat api on boot' do - expect(chef_run).to enable_service('openstack-heat-api') - end - - it 'starts heat api on boot' do - expect(chef_run).to start_service('openstack-heat-api') - end - end - end -end diff --git a/spec/api_spec.rb b/spec/api_spec.rb deleted file mode 100644 index 225c8bc..0000000 --- a/spec/api_spec.rb +++ /dev/null @@ -1,24 +0,0 @@ -require_relative 'spec_helper' - -describe 'openstack-orchestration::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 'orchestration_stubs' - include_examples 'expect runs openstack orchestration common recipe' - - it 'installs heat api packages' do - expect(chef_run).to upgrade_package 'heat-api' - end - - it 'enables heat api on boot' do - expect(chef_run).to enable_service('heat-api') - end - - it 'starts heat api on boot' do - expect(chef_run).to start_service('heat-api') - end - end -end diff --git a/spec/common-redhat_spec.rb b/spec/common-redhat_spec.rb deleted file mode 100644 index 51e9aaf..0000000 --- a/spec/common-redhat_spec.rb +++ /dev/null @@ -1,34 +0,0 @@ -require_relative 'spec_helper' - -describe 'openstack-orchestration::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 'orchestration_stubs' - include_examples 'logging' - include_examples 'expects to create heat directories' - include_examples 'expects to create heat conf' - include_examples 'expects to create heat default.yaml' - include_examples 'expect installs common heat package' - include_examples 'expect installs mysql package' - include_examples 'expect runs db migrations' - it do - expect(chef_run).to upgrade_package 'openstack-heat-common' - end - - case p - when REDHAT_7 - it do - expect(chef_run).to upgrade_package 'MySQL-python' - end - when REDHAT_8 - it do - expect(chef_run).to upgrade_package 'python3-PyMySQL' - end - end - end - end -end diff --git a/spec/common_spec.rb b/spec/common_spec.rb deleted file mode 100644 index 6c9f1e4..0000000 --- a/spec/common_spec.rb +++ /dev/null @@ -1,60 +0,0 @@ -require_relative 'spec_helper' - -describe 'openstack-orchestration::common' do - describe 'ubuntu' do - let(:runner) { ChefSpec::SoloRunner.new(UBUNTU_OPTS) } - let(:node) { runner.node } - cached(:chef_run) { runner.converge(described_recipe) } - - include_context 'orchestration_stubs' - include_examples 'logging' - include_examples 'expects to create heat directories' - include_examples 'expects to create heat conf' - include_examples 'expects to create heat default.yaml' - include_examples 'expect runs db migrations' - it do - expect(chef_run).to upgrade_package %w(heat-common python3-heat) - end - it do - expect(chef_run).to upgrade_package 'python3-mysqldb' - end - it do - expect(chef_run).to create_directory('/etc/heat').with( - owner: 'heat', - group: 'heat', - mode: '750' - ) - end - it do - expect(chef_run).to create_directory('/etc/heat/environment.d').with( - owner: 'heat', - group: 'heat', - mode: '750' - ) - end - it do - expect(chef_run).to create_template('/etc/heat/heat.conf').with( - source: 'openstack-service.conf.erb', - cookbook: 'openstack-common', - owner: 'heat', - group: 'heat', - mode: '640', - sensitive: true - ) - end - it do - expect(chef_run).to create_template('/etc/heat/environment.d/default.yaml').with( - source: 'default.yaml.erb', - owner: 'heat', - group: 'heat', - mode: '644' - ) - end - it do - expect(chef_run).to run_execute('heat-manage db_sync').with( - user: 'heat', - group: 'heat' - ) - end - end -end diff --git a/spec/dashboard-redhat_spec.rb b/spec/dashboard-redhat_spec.rb deleted file mode 100644 index 2343395..0000000 --- a/spec/dashboard-redhat_spec.rb +++ /dev/null @@ -1,16 +0,0 @@ -require_relative 'spec_helper' - -describe 'openstack-orchestration::dashboard' 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 'orchestration_stubs' - it do - expect(chef_run).to upgrade_package 'openstack-heat-ui' - end - end - end -end diff --git a/spec/dashboard_spec.rb b/spec/dashboard_spec.rb deleted file mode 100644 index 9987bb2..0000000 --- a/spec/dashboard_spec.rb +++ /dev/null @@ -1,14 +0,0 @@ -require_relative 'spec_helper' - -describe 'openstack-orchestration::dashboard' do - describe 'ubuntu' do - let(:runner) { ChefSpec::SoloRunner.new(UBUNTU_OPTS) } - let(:node) { runner.node } - cached(:chef_run) { runner.converge(described_recipe) } - - include_context 'orchestration_stubs' - it do - expect(chef_run).to upgrade_package 'python3-heat-dashboard' - end - end -end diff --git a/spec/engine-redhat_spec.rb b/spec/engine-redhat_spec.rb deleted file mode 100644 index cfe3dea..0000000 --- a/spec/engine-redhat_spec.rb +++ /dev/null @@ -1,26 +0,0 @@ -require_relative 'spec_helper' - -describe 'openstack-orchestration::engine' 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 'orchestration_stubs' - include_examples 'expect runs openstack orchestration common recipe' - - it 'installs heat engine package' do - expect(chef_run).to upgrade_package 'openstack-heat-engine' - end - - it 'enables heat engine on boot' do - expect(chef_run).to enable_service('openstack-heat-engine') - end - - it 'starts heat engine on boot' do - expect(chef_run).to start_service('openstack-heat-engine') - end - end - end -end diff --git a/spec/engine_spec.rb b/spec/engine_spec.rb deleted file mode 100644 index 68c7dc3..0000000 --- a/spec/engine_spec.rb +++ /dev/null @@ -1,24 +0,0 @@ -require_relative 'spec_helper' - -describe 'openstack-orchestration::engine' do - describe 'ubuntu' do - let(:runner) { ChefSpec::SoloRunner.new(UBUNTU_OPTS) } - let(:node) { runner.node } - cached(:chef_run) { runner.converge(described_recipe) } - - include_context 'orchestration_stubs' - include_examples 'expect runs openstack orchestration common recipe' - - it 'installs heat engine package' do - expect(chef_run).to upgrade_package 'heat-engine' - end - - it 'enables heat engine on boot' do - expect(chef_run).to enable_service('heat_engine') - end - - it 'starts heat engine on boot' do - expect(chef_run).to start_service('heat_engine') - end - end -end diff --git a/spec/identity_registration_spec.rb b/spec/identity_registration_spec.rb deleted file mode 100644 index 3c175ed..0000000 --- a/spec/identity_registration_spec.rb +++ /dev/null @@ -1,149 +0,0 @@ -require_relative 'spec_helper' - -describe 'openstack-orchestration::identity_registration' 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 'orchestration_stubs' - - connection_params = { - openstack_auth_url: 'http://127.0.0.1:5000/v3', - openstack_username: 'admin', - openstack_api_key: 'admin-pass', - openstack_project_name: 'admin', - openstack_domain_name: 'default', - } - service_name = 'heat' - service_type = 'orchestration' - service_user = 'heat' - stack_domain_admin = 'heat_domain_admin' - stack_domain_name = 'heat' - stack_domain_password = 'heat_domain_pass' - url = 'http://127.0.0.1:8004/v1/%(tenant_id)s' - region = 'RegionOne' - project_name = 'service' - role_name = 'service' - password = 'heat-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 - - 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 - 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, - password: password, - connection_params: connection_params - ) - end - - it do - expect(chef_run).to create_openstack_role( - 'heat_stack_owner' - ).with( - connection_params: connection_params - ) - end - - it do - expect(chef_run).to create_openstack_role( - 'heat_stack_user' - ).with( - connection_params: connection_params - ) - end - - it do - expect(chef_run).to grant_role_openstack_user( - service_user - ).with( - project_name: project_name, - role_name: role_name, - connection_params: connection_params - ) - end - - it do - expect(chef_run).to create_openstack_domain( - stack_domain_name - ).with( - connection_params: connection_params - ) - end - - it 'registers stack domain admin user' do - expect(chef_run).to create_openstack_user( - stack_domain_admin - ).with( - password: stack_domain_password, - connection_params: connection_params - ) - end - - it do - expect(chef_run).to grant_domain_openstack_user( - stack_domain_admin - ).with( - domain_name: stack_domain_name, - role_name: 'admin', - connection_params: connection_params - ) - end - it 'register heat cloudformation service' do - expect(chef_run).to create_openstack_service( - 'heat-cfn' - ).with( - connection_params: connection_params - ) - end - %w(internal public).each do |interface| - it "#{interface} cloudformation endpoint with default values" do - expect(chef_run).to create_openstack_endpoint( - 'cloudformation' - ).with( - service_name: 'heat-cfn', - url: 'http://127.0.0.1:8000/v1', - region: region, - connection_params: connection_params - ) - end - end - end - end -end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb deleted file mode 100644 index cd27138..0000000 --- a/spec/spec_helper.rb +++ /dev/null @@ -1,280 +0,0 @@ -require 'chefspec' -require 'chefspec/berkshelf' -require 'chef/application' - -RSpec.configure do |config| - config.color = true - config.formatter = :documentation - config.log_level = :warn -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 'orchestration_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(:address_for) - .with('lo') - .and_return '127.0.1.1' - allow_any_instance_of(Chef::Recipe).to receive(:get_password) - .with('token', 'openstack_identity_bootstrap_token') - .and_return 'bootstrap-token' - - allow_any_instance_of(Chef::Recipe).to receive(:get_password) - .with('db', 'heat') - .and_return 'heat' - 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('user', 'admin-user') - .and_return 'admin-pass' - allow_any_instance_of(Chef::Recipe).to receive(:get_password) - .with('service', 'openstack-orchestration') - .and_return 'heat-pass' - allow_any_instance_of(Chef::Recipe).to receive(:get_password) - .with('user', 'heat_domain_admin') - .and_return 'heat_domain_pass' - allow_any_instance_of(Chef::Recipe).to receive(:get_password) - .with('user', 'admin') - .and_return 'admin-pass' - allow_any_instance_of(Chef::Recipe).to receive(:get_password) - .with('token', 'orchestration_auth_encryption_key') - .and_return 'auth_encryption_key_secret' - allow_any_instance_of(Chef::Recipe).to receive(:rabbit_transport_url) - .with('orchestration') - .and_return('rabbit://guest:mypass@127.0.0.1:5672') - allow(Chef::Application).to receive(:fatal!) - end -end - -shared_examples 'expect runs openstack orchestration common recipe' do - it 'runs orchestration common recipe' do - expect(chef_run).to include_recipe 'openstack-orchestration::common' - end -end - -shared_examples 'expect runs openstack common logging recipe' do - it 'runs logging recipe if node attributes say to' do - expect(chef_run).to include_recipe 'openstack-common::logging' - end -end - -shared_examples 'expect installs common heat package' do - it 'installs the openstack-heat common package' do - expect(chef_run).to upgrade_package 'openstack-heat-common' - end -end - -shared_examples 'expect installs mysql package' do - case p - when REDHAT_7 - it 'installs mysql python packages by default' do - expect(chef_run).to upgrade_package 'MySQL-python' - end - when REDHAT_8 - it 'installs mysql python packages by default' do - expect(chef_run).to upgrade_package 'python3-PyMySQL' - end - end -end - -shared_examples 'expect runs db migrations' do - it 'runs db migrations' do - expect(chef_run).to run_execute('heat-manage db_sync').with(user: 'heat', group: 'heat') - end -end - -shared_examples 'expects to create heat directories' do - it 'creates /etc/heat' do - expect(chef_run).to create_directory('/etc/heat').with( - owner: 'heat', - group: 'heat', - mode: '750' - ) - end - - it 'creates /etc/heat/environment.d' do - expect(chef_run).to create_directory('/etc/heat/environment.d').with( - owner: 'heat', - group: 'heat', - mode: '750' - ) - end -end - -shared_examples 'expects to create heat conf' do - describe 'heat.conf' do - let(:file) { chef_run.template('/etc/heat/heat.conf') } - - it 'creates the heat.conf file' do - expect(chef_run).to create_template(file.name).with( - owner: 'heat', - group: 'heat', - mode: '640' - ) - end - - it 'sets auth_encryption_key' do - expect(chef_run).to render_config_file(file.name) - .with_section_content('DEFAULT', /^auth_encryption_key = auth_encryption_key_secret$/) - end - - describe 'default values' do - it 'has default conf values' do - [ - %r{^heat_metadata_server_url = http://127.0.0.1:8000$}, - %r{^heat_waitcondition_server_url = http://127.0.0.1:8000/v1/waitcondition$}, - %r{^log_dir = /var/log/heat$}, - /^region_name_for_services = RegionOne$/, - ].each do |line| - expect(chef_run).to render_config_file(file.name).with_section_content('DEFAULT', line) - end - end - - it 'has oslo_messaging_notifications conf values' do - [ - /^driver = heat.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 - - it 'has heat_api binding' do - [ - /^bind_host = 127.0.0.1$/, - /^bind_port = 8004$/, - ].each do |line| - expect(chef_run).to render_config_file(file.name).with_section_content('heat_api', line) - end - end - - it 'has heat_api_cfn binding' do - [ - /^bind_host = 127.0.0.1$/, - /^bind_port = 8000$/, - ].each do |line| - expect(chef_run).to render_config_file(file.name).with_section_content('heat_api_cfn', line) - end - end - - it 'sets database connection value' do - expect(chef_run).to render_config_file(file.name).with_section_content( - 'database', %r{^connection = mysql\+pymysql://heat:heat@127.0.0.1:3306/heat\?charset=utf8$} - ) - end - end - - describe 'has ec2authtoken values' do - it 'has default ec2authtoken values' do - expect(chef_run).to render_config_file(file.name) - .with_section_content('ec2authtoken', %r{^auth_uri = http://127.0.0.1:5000/v3$}) - end - end - - describe 'has clients_keystone values' do - it 'has default clients_keystone values' do - expect(chef_run).to render_config_file(file.name) - .with_section_content('clients_keystone', %r{^auth_uri = http://127.0.0.1:5000/$}) - end - end - - describe 'has oslo_messaging_rabbit values' do - it 'has default rabbit values' 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 - end - - describe 'has keystone_authtoken values' do - it 'has default keystone_authtoken values' do - [ - %r{^auth_url = http://127.0.0.1:5000/v3$}, - /^auth_type = v3password$/, - /^username = heat$/, - /^project_name = service$/, - /^user_domain_name = Default/, - /^project_domain_name = Default/, - /^password = heat-pass$/, - ].each do |line| - expect(chef_run).to render_config_file(file.name).with_section_content('keystone_authtoken', line) - end - end - end - - describe 'has trustee values' do - it 'has default trustee values' do - [ - %r{^auth_url = http://127.0.0.1:5000/v3$}, - /^auth_type = v3password$/, - /^username = heat$/, - /^password = heat-pass$/, - /^user_domain_name = Default$/, - ].each do |line| - expect(chef_run).to render_config_file(file.name).with_section_content('trustee', line) - end - end - end - end -end - -shared_examples 'expects to create heat default.yaml' do - describe 'default.yaml' do - let(:file) { chef_run.template('/etc/heat/environment.d/default.yaml') } - - it 'creates the default.yaml file' do - expect(chef_run).to create_template(file.name).with( - owner: 'heat', - group: 'heat', - mode: '644' - ) - end - end -end - -shared_examples 'logging' do - context 'with logging enabled' do - cached(:chef_run) do - node.override['openstack']['orchestration']['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 'with logging disabled' do - cached(:chef_run) do - node.override['openstack']['orchestration']['syslog']['use'] = false - runner.converge(described_recipe) - end - - it "doesn't run logging recipe" do - expect(chef_run).not_to include_recipe 'openstack-common::logging' - end - end -end diff --git a/templates/default/default.yaml.erb b/templates/default/default.yaml.erb deleted file mode 100644 index 46300b1..0000000 --- a/templates/default/default.yaml.erb +++ /dev/null @@ -1,7 +0,0 @@ -<%= node['openstack']['orchestration']['custom_template_banner'] %> - -resource_registry: - # allow older templates with Quantum in them. - "OS::Quantum*": "OS::Neutron*" - "OS::Metering::Alarm": "OS::Ceilometer::Alarm" - "AWS::RDS::DBInstance": "file:///etc/heat/templates/AWS_RDS_DBInstance.yaml"