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: Ie74b00de70c5ce8180b1d6b06394572ef8025f34
This commit is contained in:
Ghanshyam Mann 2024-02-15 14:17:39 -08:00 committed by Dr. Jens Harbott
parent f04c63bd47
commit ea238dc447
47 changed files with 8 additions and 3216 deletions

View File

@ -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"

9
.gitignore vendored
View File

@ -1,9 +0,0 @@
.bundle/
berks-cookbooks/
.kitchen
.vagrant
.coverage/
*.swp
Berksfile.lock
Vagrantfile
Gemfile.lock

View File

@ -1,4 +0,0 @@
Chef/Modernize/FoodcriticComments:
Enabled: true
Chef/Style/CopyrightCommentFormat:
Enabled: true

View File

@ -1,3 +0,0 @@
- project:
templates:
- openstack-chef-jobs

View File

@ -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

View File

@ -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
View File

@ -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.

View File

@ -1,161 +1,10 @@
OpenStack Chef Cookbook - telemetry
===================================
This project is no longer maintained.
.. image:: https://governance.openstack.org/badges/cookbook-openstack-telemetry.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 Metering service **Ceilometer** as well as
**Gnocchi** as the backend for Metrics 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. Both are currently installed from packages.
.. _OpenStack chef-repo: https://opendev.org/openstack/openstack-chef
https://docs.openstack.org/ceilometer/latest/
https://gnocchi.xyz/
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'
- 'openstackclient'
- 'openstack-common', '>= 20.0.0'
- 'openstack-identity', '>= 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 ``ceilometer.conf`` and
``gnocchi`` is described in the openstack-common cookbook.
Recipes
=======
agent-central
-------------
- Installs agent central service.
agent-compute
-------------
- Installs agent compute service.
agent-notification
------------------
- Installs agent notification service.
aodh
----
- Installs aodh service
common
------
- Common metering configuration.
gnocchi_configure
-----------------
- Configure Gnocchi
gnocchi_install
---------------
- Installs and starts the Gnocchi service
identity_registration
---------------------
- Registers the endpoints, tenant and user for metering and metric
service with Keystone.
setup
-----
- Run database migrations
License and Author
==================
+-----------------+--------------------------------------------+
| **Author** | Matt Ray (matt@opscode.com) |
+-----------------+--------------------------------------------+
| **Author** | John Dewey (jdewey@att.com) |
+-----------------+--------------------------------------------+
| **Author** | Justin Shepherd (jshepher@rackspace.com) |
+-----------------+--------------------------------------------+
| **Author** | Salman Baset (sabaset@us.ibm.com) |
+-----------------+--------------------------------------------+
| **Author** | Ionut Artarisi (iartarisi@suse.cz) |
+-----------------+--------------------------------------------+
| **Author** | Eric Zhou (zyouzhou@cn.ibm.com) |
+-----------------+--------------------------------------------+
| **Author** | Chen Zhiwei (zhiwchen@cn.ibm.com) |
+-----------------+--------------------------------------------+
| **Author** | David Geng (gengjh@cn.ibm.com) |
+-----------------+--------------------------------------------+
| **Author** | Mark Vanderwiel (vanderwl@us.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) 2013, Opscode, Inc. |
+-----------------+--------------------------------------------------+
| **Copyright** | Copyright (c) 2013, AT&T Services, Inc. |
+-----------------+--------------------------------------------------+
| **Copyright** | Copyright (c) 2013, Rackspace US, Inc. |
+-----------------+--------------------------------------------------+
| **Copyright** | Copyright (c) 2013-2014, IBM, Corp. |
+-----------------+--------------------------------------------------+
| **Copyright** | Copyright (c) 2013-2014, SUSE Linux 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
::
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.

View File

@ -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

View File

@ -1,31 +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.

View File

@ -1,19 +0,0 @@
default['openstack']['aodh']['conf_secrets'] = {}
default['openstack']['aodh']['conf'].tap do |conf|
# [keystone_authtoken] section
conf['keystone_authtoken']['username'] = 'aodh'
conf['keystone_authtoken']['project_name'] = 'service'
conf['keystone_authtoken']['auth_type'] = 'v3password'
conf['keystone_authtoken']['user_domain_name'] = 'Default'
conf['keystone_authtoken']['project_domain_name'] = 'Default'
conf['keystone_authtoken']['region_name'] = node['openstack']['region']
# [service_credentials] section
conf['service_credentials']['username'] = 'aodh'
conf['service_credentials']['project_name'] = 'service'
conf['service_credentials']['user_domain_name'] = 'Default'
conf['service_credentials']['project_domain_name'] = 'Default'
conf['service_credentials']['auth_type'] = 'v3password'
conf['service_credentials']['interface'] = 'internal'
conf['service_credentials']['region_name'] = node['openstack']['region']
end

View File

@ -1,19 +0,0 @@
default['openstack']['telemetry']['conf_secrets'] = {}
default['openstack']['telemetry']['conf'].tap do |conf|
# [keystone_authtoken] section
conf['keystone_authtoken']['username'] = 'ceilometer'
conf['keystone_authtoken']['project_name'] = 'service'
conf['keystone_authtoken']['auth_type'] = 'v3password'
conf['keystone_authtoken']['user_domain_name'] = 'Default'
conf['keystone_authtoken']['project_domain_name'] = 'Default'
conf['keystone_authtoken']['region_name'] = node['openstack']['region']
# [service_credentials] section
conf['service_credentials']['username'] = 'ceilometer'
conf['service_credentials']['project_name'] = 'service'
conf['service_credentials']['user_domain_name'] = 'Default'
conf['service_credentials']['project_domain_name'] = 'Default'
conf['service_credentials']['auth_type'] = 'v3password'
conf['service_credentials']['interface'] = 'internal'
conf['service_credentials']['region_name'] = node['openstack']['region']
end

View File

@ -1,247 +0,0 @@
#
# Cookbook:: openstack-telemetry
# Recipe:: default
#
# Copyright:: 2013-2021, AT&T Services, 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.
#
# 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']['telemetry']['custom_template_banner'] = '
# This file is automatically generated by Chef
# Any changes will be overwritten
'
# Set the endpoints for the telemetry services to allow all other cookbooks to
# access and use them
%w(telemetry telemetry_metric aodh).each do |ts|
%w(public internal admin).each do |ep_type|
default['openstack']['endpoints'][ep_type][ts]['host'] = '127.0.0.1'
default['openstack']['endpoints'][ep_type][ts]['scheme'] = 'http'
default['openstack']['endpoints'][ep_type][ts]['path'] = ''
default['openstack']['endpoints'][ep_type]['telemetry_metric']['port'] = 8041
default['openstack']['endpoints'][ep_type]['aodh']['port'] = 8042
# web-service (e.g. apache) listen address (can be different from openstack
# telemetry endpoints)
end
default['openstack']['bind_service']['all'][ts]['host'] = '127.0.0.1'
end
default['openstack']['bind_service']['all']['telemetry_metric']['port'] = 8041
default['openstack']['bind_service']['all']['aodh']['port'] = 8042
default['openstack']['telemetry']['conf_dir'] = '/etc/ceilometer'
default['openstack']['telemetry']['conf_file'] =
::File.join(node['openstack']['telemetry']['conf_dir'], 'ceilometer.conf')
default['openstack']['telemetry_metric']['conf_dir'] = '/etc/gnocchi'
default['openstack']['telemetry_metric']['conf_file'] =
::File.join(node['openstack']['telemetry_metric']['conf_dir'], 'gnocchi.conf')
default['openstack']['telemetry']['syslog']['use'] = false
default['openstack']['telemetry']['upgrade_opts'] = '--skip-gnocchi-resource-types'
default['openstack']['aodh']['conf_dir'] = '/etc/aodh'
default['openstack']['aodh']['conf_file'] =
::File.join(node['openstack']['aodh']['conf_dir'], 'aodh.conf')
default['openstack']['telemetry']['user'] = 'ceilometer'
default['openstack']['telemetry']['group'] = 'ceilometer'
default['openstack']['telemetry_metric']['user'] = 'gnocchi'
default['openstack']['telemetry_metric']['group'] = 'gnocchi'
default['openstack']['aodh']['user'] = 'aodh'
default['openstack']['aodh']['group'] = 'aodh'
default['openstack']['telemetry']['service_role'] = 'admin'
default['openstack']['telemetry_metric']['service_role'] = 'admin'
default['openstack']['aodh']['service_role'] = 'admin'
default['openstack']['telemetry_metric']['gnocchi-upgrade-options'] = ''
# Configuration for /etc/ceilometer/pipeline.yaml
default['openstack']['telemetry']['pipeline']['publishers'] = ['gnocchi://']
# Configuration for /etc/ceilometer/polling.yaml
default['openstack']['telemetry']['polling']['interval'] = 300
default['openstack']['telemetry']['polling']['meters'] =
%w(
cpu
cpu_l3_cache
memory.usage
network.incoming.bytes
network.incoming.packets
network.outgoing.bytes
network.outgoing.packets
disk.device.read.bytes
disk.device.read.requests
disk.device.write.bytes
disk.device.write.requests
hardware.cpu.util
hardware.memory.used
hardware.memory.total
hardware.memory.buffer
hardware.memory.cached
hardware.memory.swap.avail
hardware.memory.swap.total
hardware.system_stats.io.outgoing.blocks
hardware.system_stats.io.incoming.blocks
hardware.network.ip.incoming.datagrams
hardware.network.ip.outgoing.datagrams
)
%w(telemetry_metric aodh).each do |ts|
# specify whether to enable SSL for ceilometer API endpoint
default['openstack'][ts]['ssl']['enabled'] = false
# specify server whether to enforce client certificate requirement
default['openstack'][ts]['ssl']['cert_required'] = false
# SSL certificate, keyfile and CA certficate file locations
default['openstack'][ts]['ssl']['basedir'] = '/etc/ceilometer/ssl'
# Protocol for SSL (Apache)
default['openstack'][ts]['ssl']['protocol'] = 'All -SSLv2 -SSLv3'
# Which ciphers to use with the SSL/TLS protocol (Apache)
# Example: 'RSA:HIGH:MEDIUM:!LOW:!kEDH:!aNULL:!ADH:!eNULL:!EXP:!SSLv2:!SEED:!CAMELLIA:!PSK!RC4:!RC4-MD5:!RC4-SHA'
default['openstack'][ts]['ssl']['ciphers'] = nil
# path of the cert file for SSL.
default['openstack'][ts]['ssl']['certfile'] = "#{node['openstack'][ts]['ssl']['basedir']}/certs/sslcert.pem"
# path of the keyfile for SSL.
default['openstack'][ts]['ssl']['keyfile'] = "#{node['openstack'][ts]['ssl']['basedir']}/private/sslkey.pem"
default['openstack'][ts]['ssl']['chainfile'] = nil
# path of the CA cert file for SSL.
default['openstack'][ts]['ssl']['ca_certs'] = "#{node['openstack'][ts]['ssl']['basedir']}/certs/sslca.pem"
# path of the CA cert files for SSL (Apache)
default['openstack'][ts]['ssl']['ca_certs_path'] = "#{node['openstack'][ts]['ssl']['basedir']}/certs/"
end
case node['platform_family']
when 'rhel'
default['openstack']['telemetry']['platform'] =
case node['platform_version'].to_i
when 8
{
'common_packages' => %w(openstack-ceilometer-common),
'gnocchi_packages' => %w(openstack-gnocchi-api openstack-gnocchi-metricd),
'gnocchi-api_service' => 'openstack-gnocchi-api',
'gnocchi-metricd_service' => 'gnocchi-metricd',
'agent_central_packages' => %w(openstack-ceilometer-central),
'agent_central_service' => 'openstack-ceilometer-central',
'agent_compute_packages' => %w(openstack-ceilometer-compute),
'agent_compute_service' => 'openstack-ceilometer-compute',
'agent_notification_packages' => %w(openstack-ceilometer-collector openstack-ceilometer-notification),
'agent_notification_service' => 'openstack-ceilometer-notification',
'ceilometer-api_wsgi_file' => '/usr/lib/python3.6/site-packages/ceilometer/api/app.wsgi',
'gnocchi-api_wsgi_file' => '/usr/lib/python3.6/site-packages/gnocchi/rest/wsgi.py',
'package_overrides' => '',
}
when 7
{
'common_packages' => %w(openstack-ceilometer-common),
'gnocchi_packages' => %w(openstack-gnocchi-api openstack-gnocchi-metricd),
'gnocchi-api_service' => 'openstack-gnocchi-api',
'gnocchi-metricd_service' => 'gnocchi-metricd',
'agent_central_packages' => %w(openstack-ceilometer-central),
'agent_central_service' => 'openstack-ceilometer-central',
'agent_compute_packages' => %w(openstack-ceilometer-compute),
'agent_compute_service' => 'openstack-ceilometer-compute',
'agent_notification_packages' => %w(openstack-ceilometer-collector openstack-ceilometer-notification),
'agent_notification_service' => 'openstack-ceilometer-notification',
'ceilometer-api_wsgi_file' => '/usr/lib/python2.7/site-packages/ceilometer/api/app.wsgi',
'gnocchi-api_wsgi_file' => '/usr/lib/python2.7/site-packages/gnocchi/rest/wsgi.py',
'package_overrides' => '',
}
end
default['openstack']['aodh']['platform'] =
case node['platform_version'].to_i
when 8
{
'aodh_packages' =>
%w(
openstack-aodh-api
openstack-aodh-evaluator
openstack-aodh-expirer
openstack-aodh-listener
openstack-aodh-notifier
python3-aodhclient
),
'aodh_services' =>
%w(
openstack-aodh-evaluator
openstack-aodh-notifier
openstack-aodh-listener
),
'aodh-api_wsgi_file' => '/usr/lib/python3.6/site-packages/aodh/api/app.wsgi',
}
when 7
{
'aodh_packages' =>
%w(
openstack-aodh-api
openstack-aodh-evaluator
openstack-aodh-expirer
openstack-aodh-listener
openstack-aodh-notifier
python-aodhclient
),
'aodh_services' =>
%w(
openstack-aodh-evaluator
openstack-aodh-notifier
openstack-aodh-listener
),
'aodh-api_wsgi_file' => '/usr/lib/python2.7/site-packages/aodh/api/app.wsgi',
}
end
when 'debian'
default['openstack']['telemetry']['platform'] = {
'common_packages' => %w(ceilometer-common python3-ceilometer),
'gnocchi_packages' =>
%w(
gnocchi-api
gnocchi-common
gnocchi-metricd
python3-gnocchi
python3-gnocchiclient
),
'gnocchi-api_service' => 'gnocchi-api',
'gnocchi-metricd_service' => 'gnocchi-metricd',
'agent_central_packages' => %w(ceilometer-agent-central),
'agent_central_service' => 'ceilometer-agent-central',
'agent_compute_packages' => %w(ceilometer-agent-compute),
'agent_compute_service' => 'ceilometer-agent-compute',
'agent_notification_packages' => %w(ceilometer-agent-notification),
'agent_notification_service' => 'ceilometer-agent-notification',
'ceilometer-api_wsgi_file' => '/usr/lib/python3/dist-packages/ceilometer/api/app.wsgi',
'gnocchi-api_wsgi_file' => '/usr/lib/python3/dist-packages/gnocchi/rest/wsgi.py',
'package_overrides' => '',
}
default['openstack']['aodh']['platform'] = {
'aodh_packages' =>
%w(
aodh-api
aodh-evaluator
aodh-expirer
aodh-listener
aodh-notifier
python3-ceilometerclient
),
'aodh_services' =>
%w(
aodh-evaluator
aodh-notifier
aodh-listener
),
'aodh-api_wsgi_file' => '/usr/share/aodh/app.wsgi', # this file come with aodh-common which aodh-api depends on
}
end

View File

@ -1,15 +0,0 @@
default['openstack']['telemetry_metric']['conf_secrets'] = {}
default['openstack']['telemetry_metric']['conf'].tap do |conf|
# [keystone_authtoken] section
conf['keystone_authtoken']['username'] = 'gnocchi'
conf['keystone_authtoken']['project_name'] = 'service'
conf['keystone_authtoken']['auth_type'] = 'v3password'
conf['keystone_authtoken']['user_domain_name'] = 'Default'
conf['keystone_authtoken']['project_domain_name'] = 'Default'
conf['keystone_authtoken']['region_name'] = node['openstack']['region']
conf['storage']['driver'] = 'file'
if node['openstack']['telemetry_metric']['conf']['storage']['driver'] == 'file'
conf['storage']['file_basepath'] = '/var/lib/gnocchi'
end
end

View File

@ -1,31 +0,0 @@
[pipeline:main]
pipeline = gnocchi+auth
[composite:gnocchi+noauth]
use = egg:Paste#urlmap
/ = gnocchiversions
/v1 = gnocchiv1
[composite:gnocchi+auth]
use = egg:Paste#urlmap
/ = gnocchiversions
/v1 = gnocchiv1+auth
[pipeline:gnocchiv1+auth]
pipeline = keystone_authtoken gnocchiv1
[app:gnocchiversions]
paste.app_factory = gnocchi.rest.app:app_factory
root = gnocchi.rest.VersionsController
[app:gnocchiv1]
paste.app_factory = gnocchi.rest.app:app_factory
root = gnocchi.rest.V1Controller
[filter:keystone_authtoken]
paste.filter_factory = keystonemiddleware.auth_token:filter_factory
oslo_config_project = gnocchi
[filter:cors]
paste.filter_factory = oslo_middleware.cors:filter_factory
oslo_config_project = gnocchi

View File

@ -1,3 +0,0 @@
---
sources: []
sinks: []

View File

@ -1,213 +0,0 @@
---
resources:
- resource_type: identity
archive_policy: low
metrics:
- 'identity.authenticate.success'
- 'identity.authenticate.pending'
- 'identity.authenticate.failure'
- 'identity.user.created'
- 'identity.user.deleted'
- 'identity.user.updated'
- 'identity.group.created'
- 'identity.group.deleted'
- 'identity.group.updated'
- 'identity.role.created'
- 'identity.role.deleted'
- 'identity.role.updated'
- 'identity.project.created'
- 'identity.project.deleted'
- 'identity.project.updated'
- 'identity.trust.created'
- 'identity.trust.deleted'
- 'identity.role_assignment.created'
- 'identity.role_assignment.deleted'
- resource_type: ceph_account
metrics:
- 'radosgw.objects'
- 'radosgw.objects.size'
- 'radosgw.objects.containers'
- 'radosgw.api.request'
- 'radosgw.containers.objects'
- 'radosgw.containers.objects.size'
- resource_type: instance
metrics:
- 'instance'
- 'memory'
- 'memory.usage'
- 'memory.resident'
- 'vcpus'
- 'cpu'
- 'cpu.delta'
- 'cpu_util'
- 'disk.root.size'
- 'disk.ephemeral.size'
- 'disk.read.requests'
- 'disk.read.requests.rate'
- 'disk.write.requests'
- 'disk.write.requests.rate'
- 'disk.read.bytes'
- 'disk.read.bytes.rate'
- 'disk.write.bytes'
- 'disk.write.bytes.rate'
- 'disk.latency'
- 'disk.iops'
- 'disk.capacity'
- 'disk.allocation'
- 'disk.usage'
attributes:
host: resource_metadata.host
image_ref: resource_metadata.image_ref
display_name: resource_metadata.display_name
flavor_id: resource_metadata.(instance_flavor_id|(flavor.id))
server_group: resource_metadata.user_metadata.server_group
- resource_type: instance_network_interface
metrics:
- 'network.outgoing.packets.rate'
- 'network.incoming.packets.rate'
- 'network.outgoing.packets'
- 'network.incoming.packets'
- 'network.outgoing.bytes.rate'
- 'network.incoming.bytes.rate'
- 'network.outgoing.bytes'
- 'network.incoming.bytes'
attributes:
name: resource_metadata.vnic_name
instance_id: resource_metadata.instance_id
- resource_type: instance_disk
metrics:
- 'disk.device.read.requests'
- 'disk.device.read.requests.rate'
- 'disk.device.write.requests'
- 'disk.device.write.requests.rate'
- 'disk.device.read.bytes'
- 'disk.device.read.bytes.rate'
- 'disk.device.write.bytes'
- 'disk.device.write.bytes.rate'
- 'disk.device.latency'
- 'disk.device.iops'
- 'disk.device.capacity'
- 'disk.device.allocation'
- 'disk.device.usage'
attributes:
name: resource_metadata.disk_name
instance_id: resource_metadata.instance_id
- resource_type: image
metrics:
- 'image'
- 'image.size'
- 'image.download'
- 'image.serve'
attributes:
name: resource_metadata.name
container_format: resource_metadata.container_format
disk_format: resource_metadata.disk_format
- resource_type: ipmi
metrics:
- 'hardware.ipmi.node.power'
- 'hardware.ipmi.node.temperature'
- 'hardware.ipmi.node.inlet_temperature'
- 'hardware.ipmi.node.outlet_temperature'
- 'hardware.ipmi.node.fan'
- 'hardware.ipmi.node.current'
- 'hardware.ipmi.node.voltage'
- 'hardware.ipmi.node.airflow'
- 'hardware.ipmi.node.cups'
- 'hardware.ipmi.node.cpu_util'
- 'hardware.ipmi.node.mem_util'
- 'hardware.ipmi.node.io_util'
- resource_type: network
metrics:
- 'bandwidth'
- 'network'
- 'network.create'
- 'network.update'
- 'subnet'
- 'subnet.create'
- 'subnet.update'
- 'port'
- 'port.create'
- 'port.update'
- 'router'
- 'router.create'
- 'router.update'
- 'ip.floating'
- 'ip.floating.create'
- 'ip.floating.update'
- resource_type: stack
metrics:
- 'stack.create'
- 'stack.update'
- 'stack.delete'
- 'stack.resume'
- 'stack.suspend'
- resource_type: swift_account
metrics:
- 'storage.objects.incoming.bytes'
- 'storage.objects.outgoing.bytes'
- 'storage.api.request'
- 'storage.objects.size'
- 'storage.objects'
- 'storage.objects.containers'
- 'storage.containers.objects'
- 'storage.containers.objects.size'
- resource_type: volume
metrics:
- 'volume'
- 'volume.size'
- 'volume.create'
- 'volume.delete'
- 'volume.update'
- 'volume.resize'
- 'volume.attach'
- 'volume.detach'
attributes:
display_name: resource_metadata.display_name
- resource_type: host
metrics:
- 'hardware.cpu.load.1min'
- 'hardware.cpu.load.5min'
- 'hardware.cpu.load.15min'
- 'hardware.cpu.util'
- 'hardware.memory.total'
- 'hardware.memory.used'
- 'hardware.memory.swap.total'
- 'hardware.memory.swap.avail'
- 'hardware.memory.buffer'
- 'hardware.memory.cached'
- 'hardware.network.ip.outgoing.datagrams'
- 'hardware.network.ip.incoming.datagrams'
- 'hardware.system_stats.cpu.idle'
- 'hardware.system_stats.io.outgoing.blocks'
- 'hardware.system_stats.io.incoming.blocks'
attributes:
host_name: resource_metadata.resource_url
- resource_type: host_disk
metrics:
- 'hardware.disk.size.total'
- 'hardware.disk.size.used'
attributes:
host_name: resource_metadata.resource_url
device_name: resource_metadata.device
- resource_type: host_network_interface
metrics:
- 'hardware.network.incoming.bytes'
- 'hardware.network.outgoing.bytes'
- 'hardware.network.outgoing.errors'
attributes:
host_name: resource_metadata.resource_url
device_name: resource_metadata.name

View File

@ -1,19 +0,0 @@
name 'openstack-telemetry'
maintainer 'openstack-chef'
maintainer_email 'openstack-discuss@lists.openstack.org'
license 'Apache-2.0'
description 'The OpenStack Metering service Ceilometer.'
version '20.0.0'
%w(ubuntu redhat centos).each do |os|
supports os
end
depends 'apache2', '~> 8.6'
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-telemetry'
chef_version '>= 16.0'

View File

@ -1,36 +0,0 @@
#
# Cookbook:: openstack-telemetry
# Recipe:: agent-central
#
# Copyright:: 2013-2021, AT&T Services, 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.
#
include_recipe 'openstack-telemetry::common'
platform = node['openstack']['telemetry']['platform']
package platform['agent_central_packages'] do
options platform['package_overrides']
action :upgrade
end
service 'ceilometer-agent-central' do
service_name platform['agent_central_service']
subscribes :restart, "template[#{node['openstack']['telemetry']['conf_file']}]"
subscribes :restart, "template[#{::File.join(node['openstack']['telemetry']['conf_dir'], 'pipeline.yaml')}]"
subscribes :restart, "template[#{::File.join(node['openstack']['telemetry']['conf_dir'], 'polling.yaml')}]"
action [:enable, :start]
end

View File

@ -1,36 +0,0 @@
#
# Cookbook:: openstack-telemetry
# Recipe:: agent-compute
#
# Copyright:: 2013-2021, AT&T Services, 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.
#
include_recipe 'openstack-telemetry::common'
platform = node['openstack']['telemetry']['platform']
package platform['agent_compute_packages'] do
options platform['package_overrides']
action :upgrade
end
service 'ceilometer-agent-compute' do
service_name platform['agent_compute_service']
subscribes :restart, "template[#{node['openstack']['telemetry']['conf_file']}]"
subscribes :restart, "template[#{::File.join(node['openstack']['telemetry']['conf_dir'], 'pipeline.yaml')}]"
subscribes :restart, "template[#{::File.join(node['openstack']['telemetry']['conf_dir'], 'polling.yaml')}]"
action [:enable, :start]
end

View File

@ -1,35 +0,0 @@
#
# Cookbook:: openstack-telemetry
# Recipe:: agent-notification
#
# Copyright:: 2014-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-telemetry::common'
platform = node['openstack']['telemetry']['platform']
package platform['agent_notification_packages'] do
options platform['package_overrides']
action :upgrade
end
service 'ceilometer-agent-notification' do
service_name platform['agent_notification_service']
subscribes :restart, "template[#{node['openstack']['telemetry']['conf_file']}]"
subscribes :restart, "template[#{::File.join(node['openstack']['telemetry']['conf_dir'], 'pipeline.yaml')}]"
subscribes :restart, "template[#{::File.join(node['openstack']['telemetry']['conf_dir'], 'polling.yaml')}]"
action [:enable, :start]
end

View File

@ -1,160 +0,0 @@
#
# Cookbook:: openstack-telemetry
# Recipe:: aodh
#
# 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.
#
# load the methods defined in cookbook-openstack-common libraries
class ::Chef::Recipe
include ::Openstack
include Apache2::Cookbook::Helpers
end
include_recipe 'openstack-telemetry::common'
platform = node['openstack']['aodh']['platform']
package platform['aodh_packages'] do
options platform['package_overrides']
action :upgrade
end
if node['openstack']['mq']['service_type'] == 'rabbit'
node.default['openstack']['aodh']['conf_secrets']['DEFAULT']['transport_url'] = rabbit_transport_url 'aodh'
end
db_user = node['openstack']['db']['aodh']['username']
db_pass = get_password 'db', 'aodh'
bind_service = node['openstack']['bind_service']['all']['aodh']
bind_service_address = bind_address bind_service
node.default['openstack']['aodh']['conf_secrets'].tap do |conf_secrets|
conf_secrets['database']['connection'] =
db_uri('aodh', db_user, db_pass)
conf_secrets['service_credentials']['password'] =
get_password 'service', 'openstack-aodh'
conf_secrets['keystone_authtoken']['password'] =
get_password 'service', 'openstack-aodh'
end
identity_public_endpoint = public_endpoint 'identity'
auth_url = identity_public_endpoint.to_s
node.default['openstack']['aodh']['conf'].tap do |conf|
conf['api']['host'] = bind_service_address
conf['api']['port'] = bind_service['port']
conf['keystone_authtoken']['auth_url'] = auth_url
conf['service_credentials']['auth_url'] = auth_url
conf['keystone_authtoken']['memcache_servers'] = memcached_servers.join ','
end
directory node['openstack']['aodh']['conf_dir'] do
owner node['openstack']['aodh']['user']
group node['openstack']['aodh']['group']
mode '750'
end
# merge all config options and secrets to be used in the aodh.conf
aodh_conf_options = merge_config_options 'aodh'
template node['openstack']['aodh']['conf_file'] do
source 'openstack-service.conf.erb'
cookbook 'openstack-common'
owner node['openstack']['aodh']['user']
group node['openstack']['aodh']['group']
mode '640'
sensitive true
variables(
service_config: aodh_conf_options
)
notifies :restart, 'service[apache2]'
end
execute 'run aodh-dbsync' do
command 'aodh-dbsync '
user node['openstack']['aodh']['user']
group node['openstack']['aodh']['group']
end
#### Start of Apache specific work
# 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 'aodh'
apache2_module 'ssl' if node['openstack']['aodh']['ssl']['enabled']
# create the aodh-api apache directory
aodh_apache_dir = "#{default_docroot_dir}/aodh"
directory aodh_apache_dir do
owner 'root'
group 'root'
mode '755'
end
aodh_server_entry = "#{aodh_apache_dir}/app"
# NOTE: Using lazy here as the wsgi file is not available until after
# the aodh-common package is installed during execution phase.
file aodh_server_entry do
content lazy { IO.read(platform['aodh-api_wsgi_file']) }
owner 'root'
group 'root'
mode '755'
end
template "#{apache_dir}/sites-available/aodh-api.conf" do
extend Apache2::Cookbook::Helpers
source 'wsgi-template.conf.erb'
variables(
daemon_process: 'aodh-api',
server_host: bind_service['host'],
server_port: bind_service['port'],
server_entry: aodh_server_entry,
run_dir: lock_dir,
log_dir: default_log_dir,
user: node['openstack']['aodh']['user'],
group: node['openstack']['aodh']['group'],
use_ssl: node['openstack']['aodh']['ssl']['enabled'],
cert_file: node['openstack']['aodh']['ssl']['certfile'],
chain_file: node['openstack']['aodh']['ssl']['chainfile'],
key_file: node['openstack']['aodh']['ssl']['keyfile'],
ca_certs_path: node['openstack']['aodh']['ssl']['ca_certs_path'],
cert_required: node['openstack']['aodh']['ssl']['cert_required'],
protocol: node['openstack']['aodh']['ssl']['protocol'],
ciphers: node['openstack']['aodh']['ssl']['ciphers']
)
notifies :restart, 'service[apache2]'
end
apache2_site 'aodh-api' do
notifies :restart, 'service[apache2]', :immediately
end
platform['aodh_services'].each do |aodh_service|
service aodh_service do
service_name aodh_service
subscribes :restart, "template[#{node['openstack']['aodh']['conf_file']}]"
action [:enable, :start]
end
end

View File

@ -1,129 +0,0 @@
#
# Cookbook:: openstack-telemetry
# Recipe:: common
#
# Copyright:: 2013-2021, AT&T Services, Inc.
# Copyright:: 2013-2021, Craig Tracey <craigtracey@gmail.com>
# 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.
#
class ::Chef::Recipe
include ::Openstack
include Apache2::Cookbook::Helpers
end
if node['openstack']['telemetry']['syslog']['use']
include_recipe 'openstack-common::logging'
end
platform = node['openstack']['telemetry']['platform']
db_type = node['openstack']['db']['telemetry']['service_type']
package node['openstack']['db']['python_packages'][db_type] do
action :upgrade
end
package platform['common_packages'] do
options platform['package_overrides']
action :upgrade
end
if node['openstack']['mq']['service_type'] == 'rabbit'
node.default['openstack']['telemetry']['conf_secrets']['DEFAULT']['transport_url'] =
rabbit_transport_url 'telemetry'
end
db_user = node['openstack']['db']['telemetry']['username']
db_pass = get_password 'db', 'ceilometer'
# define secrets that are needed in the ceilometer.conf
node.default['openstack']['telemetry']['conf_secrets'].tap do |conf_secrets|
conf_secrets['database']['connection'] =
db_uri('telemetry', db_user, db_pass)
conf_secrets['service_credentials']['password'] =
get_password 'service', 'openstack-telemetry'
conf_secrets['keystone_authtoken']['password'] =
get_password 'service', 'openstack-telemetry'
end
identity_endpoint = public_endpoint 'identity'
auth_url = identity_endpoint.to_s
node.default['openstack']['telemetry']['conf'].tap do |conf|
conf['keystone_authtoken']['auth_url'] = auth_url
conf['service_credentials']['auth_url'] = auth_url
conf['dispatcher_gnocchi']['url'] = public_endpoint 'telemetry_metric'
conf['dispatcher_gnocchi']['filter_project'] = 'service'
end
directory node['openstack']['telemetry']['conf_dir'] do
owner node['openstack']['telemetry']['user']
group node['openstack']['telemetry']['group']
mode '750'
end
directory "#{lock_dir}/ceilometer" do
owner node['openstack']['telemetry']['user']
group node['openstack']['telemetry']['group']
mode '750'
recursive true
end
# merge all config options and secrets to be used in the ceilometer.conf
ceilometer_conf_options = merge_config_options 'telemetry'
# 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 node['openstack']['telemetry']['conf_file'] do
source 'openstack-service.conf.erb'
cookbook 'openstack-common'
owner node['openstack']['telemetry']['user']
group node['openstack']['telemetry']['group']
mode '640'
sensitive true
variables(
service_config: ceilometer_conf_options
)
end
template ::File.join(node['openstack']['telemetry']['conf_dir'], 'pipeline.yaml') do
source 'pipeline.yaml.erb'
owner node['openstack']['telemetry']['user']
group node['openstack']['telemetry']['group']
mode '640'
variables(
publishers: node['openstack']['telemetry']['pipeline']['publishers']
)
end
template ::File.join(node['openstack']['telemetry']['conf_dir'], 'polling.yaml') do
source 'polling.yaml.erb'
owner node['openstack']['telemetry']['user']
group node['openstack']['telemetry']['group']
mode '640'
variables(
interval: node['openstack']['telemetry']['polling']['interval'],
meters: node['openstack']['telemetry']['polling']['meters']
)
end

View File

@ -1,184 +0,0 @@
#
# Cookbook:: openstack-telemetry
# Recipe:: gnocchi_configure
#
# 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
include Apache2::Cookbook::Helpers
end
include_recipe 'openstack-telemetry::common'
platform = node['openstack']['telemetry']['platform']
db_user = node['openstack']['db']['telemetry_metric']['username']
db_pass = get_password 'db', 'gnocchi'
bind_service = node['openstack']['bind_service']['all']['telemetry_metric']
bind_service_address = bind_address bind_service
# define secrets that are needed in the gnocchi.conf
node.default['openstack']['telemetry_metric']['conf_secrets'].tap do |conf_secrets|
conf_secrets['database']['connection'] =
db_uri('telemetry_metric', db_user, db_pass)
conf_secrets['indexer']['url'] =
db_uri('telemetry_metric', db_user, db_pass)
conf_secrets['keystone_authtoken']['password'] =
get_password 'service', 'openstack-telemetry_metric'
end
identity_endpoint = public_endpoint 'identity'
auth_url = identity_endpoint.to_s
node.default['openstack']['telemetry_metric']['conf'].tap do |conf|
conf['api']['host'] = bind_service_address
conf['api']['port'] = bind_service['port']
conf['keystone_authtoken']['auth_url'] = auth_url
end
# merge all config options and secrets to be used in the gnocchi.conf
gnocchi_conf_options = merge_config_options 'telemetry_metric'
template node['openstack']['telemetry_metric']['conf_file'] do
source 'openstack-service.conf.erb'
cookbook 'openstack-common'
owner node['openstack']['telemetry_metric']['user']
group node['openstack']['telemetry_metric']['group']
mode '640'
sensitive true
variables(
service_config: gnocchi_conf_options
)
notifies :restart, 'service[apache2]'
end
# drop gnocchi_resources.yaml to ceilometer folder (current workaround since not
# included in ubuntu package)
cookbook_file File.join(node['openstack']['telemetry']['conf_dir'], 'gnocchi_resources.yaml') do
source 'gnocchi_resources.yaml'
owner node['openstack']['telemetry']['user']
group node['openstack']['telemetry']['group']
mode '640'
only_if { platform?('ubuntu') }
end
# drop api-paste.ini to gnocchi folder (default ini will not use keystone auth)
cookbook_file File.join(node['openstack']['telemetry_metric']['conf_dir'], 'api-paste.ini') do
source 'api-paste.ini'
owner node['openstack']['telemetry_metric']['user']
group node['openstack']['telemetry_metric']['group']
mode '640'
end
# drop event_pipeline.yaml to ceilometer folder (gnocchi does not use events and
# the default event_pipeline.yaml will lead to a queue "event.sample" in rabbit
# without a consumer)
cookbook_file File.join(node['openstack']['telemetry']['conf_dir'], 'event_pipeline.yaml') do
source 'event_pipeline.yaml'
owner node['openstack']['telemetry']['user']
group node['openstack']['telemetry']['group']
mode '640'
end
if node['openstack']['telemetry_metric']['conf']['storage']['driver'] == 'file'
# default store is file, so create needed directories with correct permissions
# (on ubuntu they are created by the package, but owned by root and not writable
# for gnocchi)
store_path = node['openstack']['telemetry_metric']['conf']['storage']['file_basepath']
%w(tmp measure cache).each do |dir|
directory File.join(store_path, dir) do
owner node['openstack']['telemetry_metric']['user']
group node['openstack']['telemetry_metric']['group']
recursive true
mode '750'
end
end
end
# dbsync for gnocchi
execute 'run gnocchi-upgrade' do
command "gnocchi-upgrade #{node['openstack']['telemetry_metric']['gnocchi-upgrade-options']}"
user node['openstack']['telemetry_metric']['user']
group node['openstack']['telemetry_metric']['group']
end
#### Start of Apache specific work
# 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 'gnocchi'
apache2_module 'ssl' if node['openstack']['telemetry_metric']['ssl']['enabled']
# create the gnocchi-api apache directory
gnocchi_apache_dir = "#{default_docroot_dir}/gnocchi"
directory gnocchi_apache_dir do
owner 'root'
group 'root'
mode '755'
end
gnocchi_server_entry = "#{gnocchi_apache_dir}/app"
# NOTE: Using lazy here as the wsgi file is not available until after
# the gnocchik-api package is installed during execution phase.
file gnocchi_server_entry do
content lazy { IO.read(platform['gnocchi-api_wsgi_file']) }
owner 'root'
group 'root'
mode '755'
end
template "#{apache_dir}/sites-available/gnocchi-api.conf" do
extend Apache2::Cookbook::Helpers
source 'wsgi-template.conf.erb'
variables(
daemon_process: 'gnocchi-api',
server_host: bind_service['host'],
server_port: bind_service['port'],
server_entry: gnocchi_server_entry,
run_dir: lock_dir,
log_dir: default_log_dir,
log_debug: node['openstack']['telemetry_metric']['debug'],
user: node['openstack']['telemetry_metric']['user'],
group: node['openstack']['telemetry_metric']['group'],
use_ssl: node['openstack']['telemetry_metric']['ssl']['enabled'],
cert_file: node['openstack']['telemetry_metric']['ssl']['certfile'],
chain_file: node['openstack']['telemetry_metric']['ssl']['chainfile'],
key_file: node['openstack']['telemetry_metric']['ssl']['keyfile'],
ca_certs_path: node['openstack']['telemetry_metric']['ssl']['ca_certs_path'],
cert_required: node['openstack']['telemetry_metric']['ssl']['cert_required'],
protocol: node['openstack']['telemetry_metric']['ssl']['protocol'],
ciphers: node['openstack']['telemetry_metric']['ssl']['ciphers']
)
notifies :restart, 'service[apache2]'
end
apache2_site 'gnocchi-api' do
notifies :restart, 'service[apache2]', :immediately
end
service 'gnocchi-metricd' do
service_name platform['gnocchi-metricd_service']
subscribes :restart, "template[#{node['openstack']['telemetry_metric']['conf_file']}]"
action [:enable, :start]
end

View File

@ -1,32 +0,0 @@
#
# Cookbook:: openstack-telemetry
# Recipe:: gnocchi_install
#
# 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-telemetry::common'
platform = node['openstack']['telemetry']['platform']
package platform['gnocchi_packages'] do
options platform['package_overrides']
action :upgrade
end
# stop and disable the service gnocchi-api_service itself, since it should be run inside
# of apache
service platform['gnocchi-api_service'] do
action [:stop, :disable]
end

View File

@ -1,101 +0,0 @@
#
# Cookbook:: openstack-telemetry
# Recipe:: identity_registration
#
# Copyright:: 2013-2021, AT&T Services, 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.
#
# Include OS
class ::Chef::Recipe
include ::Openstack
end
identity_endpoint = public_endpoint 'identity'
auth_url = identity_endpoint.to_s
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']['telemetry']['conf']['keystone_authtoken']['user_domain_name']
endpoint_type = node['openstack']['identity']['endpoint_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,
openstack_endpoint_type: endpoint_type,
}
%w(telemetry telemetry_metric aodh).each do |telemetry_service|
case telemetry_service
when 'telemetry'
service_name = 'ceilometer'
service_type = 'metering'
when 'telemetry_metric'
service_name = 'gnocchi'
service_type = 'metric'
when 'aodh'
service_name = 'aodh'
service_type = 'alarming'
end
interfaces = {
public: { url: public_endpoint(telemetry_service) },
internal: { url: internal_endpoint(telemetry_service) },
}
service_pass = get_password 'service', "openstack-#{telemetry_service}"
service_role = node['openstack'][telemetry_service]['service_role']
service_user =
node['openstack'][telemetry_service]['conf']['keystone_authtoken']['username']
service_tenant_name =
node['openstack'][telemetry_service]['conf']['keystone_authtoken']['project_name']
region = node['openstack']['region']
# Register telemetry_service Service
openstack_service service_name do
type service_type
connection_params connection_params
end
interfaces.each do |interface, res|
# Register telemetry_service 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
# Register Service Tenant
openstack_project service_tenant_name do
connection_params connection_params
end
# Register Service User
openstack_user service_user do
domain_name service_domain_name
role_name service_role
project_name service_tenant_name
password service_pass
connection_params connection_params
action [:create, :grant_role]
end
end

View File

@ -1,27 +0,0 @@
#
# Cookbook:: openstack-telemetry
# Recipe:: common
#
# 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
conf_switch = "--config-file #{node['openstack']['telemetry']['conf_file']}"
execute 'ceilometer database migration' do
command "ceilometer-upgrade #{node['openstack']['telemetry']['upgrade_opts']} #{conf_switch}"
end

View File

@ -1,22 +0,0 @@
require_relative 'spec_helper'
describe 'openstack-telemetry::agent-central' 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 'telemetry-stubs'
include_examples 'expect-runs-common-recipe'
it 'installs the agent-central package' do
expect(chef_run).to upgrade_package 'openstack-ceilometer-central'
end
it 'starts the agent-central service' do
expect(chef_run).to start_service 'openstack-ceilometer-central'
end
end
end
end

View File

@ -1,36 +0,0 @@
require_relative 'spec_helper'
describe 'openstack-telemetry::agent-central' do
describe 'ubuntu' do
let(:runner) { ChefSpec::SoloRunner.new(UBUNTU_OPTS) }
let(:node) { runner.node }
cached(:chef_run) { runner.converge(described_recipe) }
include_context 'telemetry-stubs'
include_examples 'expect-runs-common-recipe'
it 'installs the agent-central package' do
expect(chef_run).to upgrade_package 'ceilometer-agent-central'
end
it 'starts and enables the agent-central service' do
expect(chef_run).to enable_service('ceilometer-agent-central')
expect(chef_run).to start_service('ceilometer-agent-central')
end
describe 'ceilometer-agent-central' do
it 'subscribes to its config file' do
expect(chef_run.service('ceilometer-agent-central')).to \
subscribe_to('template[/etc/ceilometer/ceilometer.conf]').delayed
end
it 'subscribes to /etc/ceilometer/pipeline.yaml' do
expect(chef_run.service('ceilometer-agent-central')).to \
subscribe_to('template[/etc/ceilometer/pipeline.yaml]').delayed
end
it 'subscribes to /etc/ceilometer/polling.yaml' do
expect(chef_run.service('ceilometer-agent-central')).to \
subscribe_to('template[/etc/ceilometer/polling.yaml]').delayed
end
end
end
end

View File

@ -1,22 +0,0 @@
require_relative 'spec_helper'
describe 'openstack-telemetry::agent-compute' 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 'telemetry-stubs'
include_examples 'expect-runs-common-recipe'
it 'installs the agent-compute package' do
expect(chef_run).to upgrade_package 'openstack-ceilometer-compute'
end
it 'starts ceilometer-agent-compute service' do
expect(chef_run).to start_service('openstack-ceilometer-compute')
end
end
end
end

View File

@ -1,36 +0,0 @@
require_relative 'spec_helper'
describe 'openstack-telemetry::agent-compute' do
describe 'ubuntu' do
let(:runner) { ChefSpec::SoloRunner.new(UBUNTU_OPTS) }
let(:node) { runner.node }
cached(:chef_run) { runner.converge(described_recipe) }
include_context 'telemetry-stubs'
include_examples 'expect-runs-common-recipe'
it 'installs the agent-compute package' do
expect(chef_run).to upgrade_package 'ceilometer-agent-compute'
end
it 'enables and starts the ceilometer-agent-compute service' do
expect(chef_run).to enable_service('ceilometer-agent-compute')
expect(chef_run).to start_service('ceilometer-agent-compute')
end
describe 'ceilometer-agent-compute' do
it 'subscribes to its config file' do
expect(chef_run.service('ceilometer-agent-compute')).to \
subscribe_to('template[/etc/ceilometer/ceilometer.conf]').delayed
end
it 'subscribes to /etc/ceilometer/pipeline.yaml' do
expect(chef_run.service('ceilometer-agent-compute')).to \
subscribe_to('template[/etc/ceilometer/pipeline.yaml]').delayed
end
it 'subscribes to /etc/ceilometer/polling.yaml' do
expect(chef_run.service('ceilometer-agent-compute')).to \
subscribe_to('template[/etc/ceilometer/polling.yaml]').delayed
end
end
end
end

View File

@ -1,22 +0,0 @@
require_relative 'spec_helper'
describe 'openstack-telemetry::agent-notification' 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 'telemetry-stubs'
include_examples 'expect-runs-common-recipe'
it do
expect(chef_run).to upgrade_package %w(openstack-ceilometer-collector openstack-ceilometer-notification)
end
it 'starts the agent-notification service' do
expect(chef_run).to start_service 'openstack-ceilometer-notification'
end
end
end
end

View File

@ -1,36 +0,0 @@
require_relative 'spec_helper'
describe 'openstack-telemetry::agent-notification' do
describe 'ubuntu' do
let(:runner) { ChefSpec::SoloRunner.new(UBUNTU_OPTS) }
let(:node) { runner.node }
cached(:chef_run) { runner.converge(described_recipe) }
include_context 'telemetry-stubs'
include_examples 'expect-runs-common-recipe'
it 'installs the agent-notification package' do
expect(chef_run).to upgrade_package 'ceilometer-agent-notification'
end
it 'enables and starts ceilometer-agent-notification service' do
expect(chef_run).to enable_service('ceilometer-agent-notification')
expect(chef_run).to start_service('ceilometer-agent-notification')
end
describe 'ceilometer-agent-notification' do
it 'subscribes to its config file' do
expect(chef_run.service('ceilometer-agent-notification')).to \
subscribe_to('template[/etc/ceilometer/ceilometer.conf]').delayed
end
it 'subscribes to /etc/ceilometer/pipeline.yaml' do
expect(chef_run.service('ceilometer-agent-notification')).to \
subscribe_to('template[/etc/ceilometer/pipeline.yaml]').delayed
end
it 'subscribes to /etc/ceilometer/polling.yaml' do
expect(chef_run.service('ceilometer-agent-notification')).to \
subscribe_to('template[/etc/ceilometer/polling.yaml]').delayed
end
end
end
end

View File

@ -1,36 +0,0 @@
require_relative 'spec_helper'
describe 'openstack-telemetry::aodh' 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 'telemetry-stubs'
case p
when REDHAT_7
it 'installs the aodh packages' do
expect(chef_run).to upgrade_package %w(openstack-aodh-api openstack-aodh-evaluator openstack-aodh-expirer openstack-aodh-listener openstack-aodh-notifier python-aodhclient)
end
when REDHAT_8
it 'installs the aodh packages' do
expect(chef_run).to upgrade_package %w(openstack-aodh-api openstack-aodh-evaluator openstack-aodh-expirer openstack-aodh-listener openstack-aodh-notifier python3-aodhclient)
end
end
it 'starts aodh services' do
expect(chef_run).to start_service('openstack-aodh-evaluator')
expect(chef_run).to start_service('openstack-aodh-notifier')
expect(chef_run).to start_service('openstack-aodh-listener')
end
it 'subscribes to /etc/aodh/aodh.conf' do
expect(chef_run.service('openstack-aodh-evaluator')).to subscribe_to('template[/etc/aodh/aodh.conf]')
expect(chef_run.service('openstack-aodh-notifier')).to subscribe_to('template[/etc/aodh/aodh.conf]')
expect(chef_run.service('openstack-aodh-listener')).to subscribe_to('template[/etc/aodh/aodh.conf]')
end
end
end
end

View File

@ -1,270 +0,0 @@
require_relative 'spec_helper'
describe 'openstack-telemetry::aodh' do
describe 'ubuntu' do
let(:runner) { ChefSpec::SoloRunner.new(UBUNTU_OPTS) }
let(:node) { runner.node }
cached(:chef_run) { runner.converge(described_recipe) }
include_context 'telemetry-stubs'
it 'installs aodh packages' do
expect(chef_run).to upgrade_package %w(aodh-api aodh-evaluator aodh-expirer aodh-listener aodh-notifier python3-ceilometerclient)
end
it do
expect(chef_run).to install_apache2_install('openstack').with(listen: %w(127.0.0.1:8042))
end
it do
expect(chef_run).to create_apache2_mod_wsgi 'aodh'
end
it do
expect(chef_run).to_not enable_apache2_module('ssl')
end
describe 'aodh.conf' do
let(:file) { chef_run.template('/etc/aodh/aodh.conf') }
it do
expect(chef_run).to create_directory('/etc/aodh')
end
it do
expect(chef_run).to create_template(file.name).with(
source: 'openstack-service.conf.erb',
cookbook: 'openstack-common',
user: 'aodh',
group: 'aodh',
mode: '640',
sensitive: true,
variables: {
service_config: {
'DEFAULT' => {
'transport_url' => 'rabbit://guest:mypass@127.0.0.1:5672' },
'api' => {
'host' => '127.0.0.1',
'port' => 8042,
},
'database' => {
'connection' => 'mysql+pymysql://aodh:aodh-dbpass@127.0.0.1:3306/aodh?charset=utf8' },
'keystone_authtoken' => {
'auth_type' => 'v3password',
'auth_url' => 'http://127.0.0.1:5000/v3',
'memcache_servers' => '',
'password' => 'aodh-pass',
'project_domain_name' => 'Default',
'project_name' => 'service',
'region_name' => 'RegionOne',
'user_domain_name' => 'Default',
'username' => 'aodh',
},
'service_credentials' => {
'auth_type' => 'v3password',
'auth_url' => 'http://127.0.0.1:5000/v3',
'interface' => 'internal',
'password' => 'aodh-pass',
'project_domain_name' => 'Default',
'project_name' => 'service',
'region_name' => 'RegionOne',
'user_domain_name' => 'Default',
'username' => 'aodh',
},
},
}
)
end
it do
[
/^username = aodh$/,
/^user_domain_name = Default$/,
/^project_name = service$/,
/^project_domain_name = Default$/,
/^auth_type = v3password$/,
/^region_name = RegionOne$/,
%r{auth_url = http://127\.0\.0\.1:5000/v3},
/^password = aodh-pass$/,
].each do |line|
expect(chef_run).to render_config_file(file.name)
.with_section_content('keystone_authtoken', line)
end
end
it do
[
/^host = 127\.0\.0\.1$/,
/^port = 8042$/,
].each do |line|
expect(chef_run).to render_config_file(file.name)
.with_section_content('api', line)
end
end
it do
expect(chef_run).to render_config_file(file.name)
.with_section_content(
'database',
%(connection = mysql+pymysql://aodh:aodh-dbpass@127.0.0.1:3306/aodh?charset=utf8)
)
end
end
it do
expect(chef_run).to run_execute('run aodh-dbsync')
.with(
command: 'aodh-dbsync ',
user: 'aodh'
)
end
it 'creates directory /var/www/html/aodh' do
expect(chef_run).to create_directory('/var/www/html/aodh').with(
user: 'root',
group: 'root',
mode: '755'
)
end
it 'creates wsgi file' do
expect(chef_run).to create_file('/var/www/html/aodh/app').with(
user: 'root',
group: 'root',
mode: '755'
)
end
describe 'apache wsgi' do
file = '/etc/apache2/sites-available/aodh-api.conf'
it "creates #{file}" do
expect(chef_run).to create_template(file).with(
source: 'wsgi-template.conf.erb',
variables: {
ca_certs_path: '/etc/ceilometer/ssl/certs/',
cert_file: '/etc/ceilometer/ssl/certs/sslcert.pem',
cert_required: false,
chain_file: nil,
ciphers: nil,
daemon_process: 'aodh-api',
group: 'aodh',
key_file: '/etc/ceilometer/ssl/private/sslkey.pem',
log_dir: '/var/log/apache2',
protocol: 'All -SSLv2 -SSLv3',
run_dir: '/var/lock',
server_entry: '/var/www/html/aodh/app',
server_host: '127.0.0.1',
server_port: 8042,
user: 'aodh',
use_ssl: false,
}
)
end
context "configures #{file} common lines" do
cached(:chef_run) do
node.override['openstack']['telemetry_metric']['custom_template_banner'] = 'custom_template_banner_value'
runner.converge(described_recipe)
end
[
/^<VirtualHost 127.0.0.1:8042>$/,
/WSGIDaemonProcess aodh-api processes=2 threads=10 user=aodh group=aodh display-name=%{GROUP}$/,
/WSGIProcessGroup aodh-api$/,
%r{WSGIScriptAlias / /var/www/html/aodh/app$},
%r{^WSGISocketPrefix /var/lock$},
%r{ErrorLog /var/log/apache2/aodh-api_error.log$},
%r{CustomLog /var/log/apache2/aodh-api_access.log combined$},
].each do |line|
it do
expect(chef_run).to render_file(file).with_content(line)
end
end
end
it "does not configure #{file} triggered common lines" do
[
/LogLevel/,
/SSL/,
].each do |line|
expect(chef_run).not_to render_file(file).with_content(line)
end
end
context 'Enable SSL' do
cached(:chef_run) do
node.override['openstack']['aodh']['ssl']['enabled'] = true
runner.converge(described_recipe)
end
it do
expect(chef_run).to enable_apache2_module('ssl')
end
it "configures #{file} common ssl lines" do
[
/SSLEngine On$/,
%r{SSLCertificateFile /etc/ceilometer/ssl/certs/sslcert.pem$},
%r{SSLCertificateKeyFile /etc/ceilometer/ssl/private/sslkey.pem$},
%r{SSLCACertificatePath /etc/ceilometer/ssl/certs/$},
/SSLProtocol All -SSLv2 -SSLv3$/,
].each do |line|
expect(chef_run).to render_file(file).with_content(line)
end
end
it "does not configure #{file} common ssl lines" do
[
/SSLCertificateChainFile/,
/SSLCipherSuite/,
/SSLVerifyClient require/,
].each do |line|
expect(chef_run).not_to render_file(file).with_content(line)
end
end
context 'Enable chainfile, ciphers, cert_required' do
cached(:chef_run) do
node.override['openstack']['aodh']['ssl']['enabled'] = true
node.override['openstack']['aodh']['ssl']['chainfile'] =
'/etc/ceilometer/ssl/certs/chainfile.pem'
node.override['openstack']['aodh']['ssl']['ciphers'] = 'ciphers_value'
node.override['openstack']['aodh']['ssl']['cert_required'] = true
runner.converge(described_recipe)
end
it "configures #{file} chainfile when set" do
expect(chef_run).to render_file(file)
.with_content(%r{SSLCertificateChainFile /etc/ceilometer/ssl/certs/chainfile.pem$})
end
it "configures #{file} ciphers when set" do
expect(chef_run).to render_file(file)
.with_content(/SSLCipherSuite ciphers_value$/)
end
it "configures #{file} cert_required set" do
expect(chef_run).to render_file(file)
.with_content(/SSLVerifyClient require$/)
end
end
end
describe 'restart apache' do
it do
expect(chef_run.template('/etc/apache2/sites-available/aodh-api.conf')).to \
notify('service[apache2]').to(:restart)
end
it do
expect(chef_run.apache2_site('aodh-api')).to notify('service[apache2]').to(:restart).immediately
end
end
%w(
aodh-evaluator
aodh-notifier
aodh-listener
).each do |aodh_service|
it do
expect(chef_run).to start_service(aodh_service).with(service_name: aodh_service)
expect(chef_run).to enable_service(aodh_service).with(service_name: aodh_service)
end
it do
expect(chef_run.service(aodh_service)).to subscribe_to('template[/etc/aodh/aodh.conf]')
end
end
end
end
end

View File

@ -1,28 +0,0 @@
require_relative 'spec_helper'
describe 'openstack-telemetry::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 'telemetry-stubs'
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
it 'installs the common packages' do
expect(chef_run).to upgrade_package %w(openstack-ceilometer-common)
end
end
end
end

View File

@ -1,188 +0,0 @@
require_relative 'spec_helper'
describe 'openstack-telemetry::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 'telemetry-stubs'
context 'with logging enabled' do
cached(:chef_run) do
node.override['openstack']['telemetry']['syslog']['use'] = true
runner.converge(described_recipe)
end
it 'runs logging recipe' do
expect(chef_run).to include_recipe 'openstack-common::logging'
end
end
it 'installs mysql python packages by default' do
expect(chef_run).to upgrade_package 'python3-mysqldb'
end
it 'installs the common packages' do
expect(chef_run).to upgrade_package %w(ceilometer-common python3-ceilometer)
end
describe '/etc/ceilometer/pipeline.yaml' do
pipeline_yaml = <<-EOL
publishers:
- gnocchi://
EOL
it do
expect(chef_run).to create_template('/etc/ceilometer/pipeline.yaml')
.with(
source: 'pipeline.yaml.erb',
owner: 'ceilometer',
group: 'ceilometer',
mode: '640'
)
end
it do
expect(chef_run).to render_file('/etc/ceilometer/pipeline.yaml').with_content(pipeline_yaml)
end
end
describe '/etc/ceilometer/polling.yaml' do
polling_yaml = <<-EOL
# This file is automatically generated by Chef
# Any changes will be overwritten
---
sources:
- name: some_pollsters
interval: 300
meters:
- cpu
- cpu_l3_cache
- memory.usage
- network.incoming.bytes
- network.incoming.packets
- network.outgoing.bytes
- network.outgoing.packets
- disk.device.read.bytes
- disk.device.read.requests
- disk.device.write.bytes
- disk.device.write.requests
- hardware.cpu.util
- hardware.memory.used
- hardware.memory.total
- hardware.memory.buffer
- hardware.memory.cached
- hardware.memory.swap.avail
- hardware.memory.swap.total
- hardware.system_stats.io.outgoing.blocks
- hardware.system_stats.io.incoming.blocks
- hardware.network.ip.incoming.datagrams
- hardware.network.ip.outgoing.datagrams
EOL
it do
expect(chef_run).to create_template('/etc/ceilometer/polling.yaml')
.with(
source: 'polling.yaml.erb',
owner: 'ceilometer',
group: 'ceilometer',
mode: '640'
)
end
it do
expect(chef_run).to render_file('/etc/ceilometer/polling.yaml').with_content(polling_yaml)
end
end
describe '/etc/ceilometer' do
let(:dir) { chef_run.directory('/etc/ceilometer') }
it 'creates the /etc/ceilometer directory' do
expect(chef_run).to create_directory(dir.name).with(
user: 'ceilometer',
group: 'ceilometer',
mode: '750'
)
end
end
describe 'ceilometer.conf' do
let(:file) { chef_run.template('/etc/ceilometer/ceilometer.conf') }
it 'creates the file' do
expect(chef_run).to create_template(file.name).with(
source: 'openstack-service.conf.erb',
cookbook: 'openstack-common',
user: 'ceilometer',
group: 'ceilometer',
mode: '640',
sensitive: true
)
end
it do
[
/^username = ceilometer$/,
/^project_name = service$/,
/^user_domain_name = Default/,
/^project_domain_name = Default/,
/^auth_type = v3password$/,
/^region_name = RegionOne$/,
%r{auth_url = http://127\.0\.0\.1:5000/v3},
/^password = ceilometer-pass$/,
].each do |line|
expect(chef_run).to render_config_file(file.name)
.with_section_content('keystone_authtoken', line)
end
end
it do
[
/^username = ceilometer$/,
/^project_name = service$/,
/^user_domain_name = Default/,
/^project_domain_name = Default/,
/^auth_type = v3password$/,
/^interface = internal$/,
/^region_name = RegionOne$/,
%r{auth_url = http://127\.0\.0\.1:5000/v3},
/^password = ceilometer-pass$/,
].each do |line|
expect(chef_run).to render_config_file(file.name)
.with_section_content('service_credentials', line)
end
end
it do
[
%r{url = http://127\.0\.0\.1:8041},
/^filter_project = service$/,
].each do |line|
expect(chef_run).to render_config_file(file.name)
.with_section_content('dispatcher_gnocchi', line)
end
end
it 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
it do
expect(chef_run).to render_config_file(file.name)
.with_section_content(
'database',
%(connection = mysql+pymysql://ceilometer:ceilometer-dbpass@127.0.0.1:3306/ceilometer?charset=utf8)
)
end
end
end
end

View File

@ -1,23 +0,0 @@
require_relative 'spec_helper'
describe 'openstack-telemetry::gnocchi_configure' 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 'telemetry-stubs'
it do
expect(chef_run).to_not create_cookbook_file('/etc/ceilometer/gnocchi_resources.yaml')
.with(
source: 'gnocchi_resources.yaml',
owner: 'ceilometer',
group: 'ceilometer',
mode: '640'
)
end
end
end
end

View File

@ -1,287 +0,0 @@
require_relative 'spec_helper'
describe 'openstack-telemetry::gnocchi_configure' do
describe 'ubuntu' do
let(:runner) { ChefSpec::SoloRunner.new(UBUNTU_OPTS) }
let(:node) { runner.node }
cached(:chef_run) { runner.converge(described_recipe) }
include_context 'telemetry-stubs'
it do
expect(chef_run).to install_apache2_install('openstack').with(listen: %w(127.0.0.1:8041))
end
it do
expect(chef_run).to create_apache2_mod_wsgi 'gnocchi'
end
it do
expect(chef_run).to_not enable_apache2_module('ssl')
end
describe 'gnocchi.conf' do
let(:file) { chef_run.template('/etc/gnocchi/gnocchi.conf') }
it do
expect(chef_run).to create_template(file.name).with(
source: 'openstack-service.conf.erb',
cookbook: 'openstack-common',
user: 'gnocchi',
group: 'gnocchi',
mode: '640',
sensitive: true
)
end
it do
[
/^username = gnocchi$/,
/^user_domain_name = Default$/,
/^project_name = service$/,
/^project_domain_name = Default$/,
/^auth_type = v3password$/,
/^region_name = RegionOne$/,
%r{auth_url = http://127\.0\.0\.1:5000/v3},
/^password = gnocchi-pass$/,
].each do |line|
expect(chef_run).to render_config_file(file.name)
.with_section_content('keystone_authtoken', line)
end
end
it do
[
/^host = 127\.0\.0\.1$/,
/^port = 8041$/,
].each do |line|
expect(chef_run).to render_config_file(file.name)
.with_section_content('api', line)
end
end
it do
expect(chef_run).to render_config_file(file.name)
.with_section_content(
'database',
%(connection = mysql+pymysql://gnocchi:gnocchi-dbpass@127.0.0.1:3306/gnocchi?charset=utf8)
)
end
it do
expect(chef_run).to render_config_file(file.name)
.with_section_content(
'indexer',
%(url = mysql+pymysql://gnocchi:gnocchi-dbpass@127.0.0.1:3306/gnocchi?charset=utf8)
)
end
end
it do
expect(chef_run).to create_cookbook_file('/etc/ceilometer/gnocchi_resources.yaml')
.with(
source: 'gnocchi_resources.yaml',
owner: 'ceilometer',
group: 'ceilometer',
mode: '640'
)
end
it do
expect(chef_run).to create_cookbook_file('/etc/gnocchi/api-paste.ini')
.with(
source: 'api-paste.ini',
owner: 'gnocchi',
group: 'gnocchi',
mode: '640'
)
end
it do
expect(chef_run).to create_cookbook_file('/etc/ceilometer/event_pipeline.yaml')
.with(
source: 'event_pipeline.yaml',
owner: 'ceilometer',
group: 'ceilometer',
mode: '640'
)
end
%w(tmp measure cache).each do |dir|
describe "gnocchi #{dir} dir" do
it 'file as storage backend' do
expect(chef_run).to create_directory("/var/lib/gnocchi/#{dir}")
.with(
user: 'gnocchi',
group: 'gnocchi',
mode: '750'
)
end
context 'other storage backend' do
cached(:chef_run) do
node.override['openstack']['telemetry_metric']['conf']['storage']['driver'] = 'ceph'
runner.converge(described_recipe)
end
it do
expect(chef_run).to_not create_directory("/var/lib/gnocchi/#{dir}")
.with(
user: 'gnocchi',
group: 'gnocchi',
mode: '750'
)
end
end
end
end
it do
expect(chef_run).to run_execute('run gnocchi-upgrade')
.with(
command: 'gnocchi-upgrade ',
user: 'gnocchi'
)
end
it do
expect(chef_run).to enable_service('gnocchi-metricd')
end
it do
expect(chef_run).to start_service('gnocchi-metricd')
end
it 'creates directory /var/www/html/gnocchi' do
expect(chef_run).to create_directory('/var/www/html/gnocchi').with(
user: 'root',
group: 'root',
mode: '755'
)
end
it 'creates wsgi file' do
expect(chef_run).to create_file('/var/www/html/gnocchi/app').with(
user: 'root',
group: 'root',
mode: '755'
)
end
describe 'apache wsgi' do
file = '/etc/apache2/sites-available/gnocchi-api.conf'
it "creates #{file}" do
expect(chef_run).to create_template(file).with(
source: 'wsgi-template.conf.erb',
variables: {
ca_certs_path: '/etc/ceilometer/ssl/certs/',
cert_file: '/etc/ceilometer/ssl/certs/sslcert.pem',
cert_required: false,
chain_file: nil,
ciphers: nil,
daemon_process: 'gnocchi-api',
group: 'gnocchi',
key_file: '/etc/ceilometer/ssl/private/sslkey.pem',
log_debug: nil,
log_dir: '/var/log/apache2',
protocol: 'All -SSLv2 -SSLv3',
run_dir: '/var/lock',
server_entry: '/var/www/html/gnocchi/app',
server_host: '127.0.0.1',
server_port: 8041,
user: 'gnocchi',
use_ssl: false,
}
)
end
context "configures #{file} common lines" do
cached(:chef_run) do
node.override['openstack']['telemetry_metric']['custom_template_banner'] = 'custom_template_banner_value'
runner.converge(described_recipe)
end
[
/^<VirtualHost 127.0.0.1:8041>$/,
/WSGIDaemonProcess gnocchi-api processes=2 threads=10 user=gnocchi group=gnocchi display-name=%{GROUP}$/,
/WSGIProcessGroup gnocchi-api$/,
%r{WSGIScriptAlias / /var/www/html/gnocchi/app$},
%r{^WSGISocketPrefix /var/lock$},
%r{ErrorLog /var/log/apache2/gnocchi-api_error.log$},
%r{CustomLog /var/log/apache2/gnocchi-api_access.log combined$},
].each do |line|
it do
expect(chef_run).to render_file(file).with_content(line)
end
end
end
it "does not configure #{file} triggered common lines" do
[
/LogLevel/,
/SSL/,
].each do |line|
expect(chef_run).not_to render_file(file).with_content(line)
end
end
context 'Enable SSL' do
cached(:chef_run) do
node.override['openstack']['telemetry_metric']['ssl']['enabled'] = true
runner.converge(described_recipe)
end
it do
expect(chef_run).to enable_apache2_module('ssl')
end
it "configures #{file} common ssl lines" do
[
/SSLEngine On$/,
%r{SSLCertificateFile /etc/ceilometer/ssl/certs/sslcert.pem$},
%r{SSLCertificateKeyFile /etc/ceilometer/ssl/private/sslkey.pem$},
%r{SSLCACertificatePath /etc/ceilometer/ssl/certs/$},
/SSLProtocol All -SSLv2 -SSLv3$/,
].each do |line|
expect(chef_run).to render_file(file).with_content(line)
end
end
it "does not configure #{file} common ssl lines" do
[
/SSLCertificateChainFile/,
/SSLCipherSuite/,
/SSLVerifyClient require/,
].each do |line|
expect(chef_run).not_to render_file(file).with_content(line)
end
end
context 'Enable chainfile, ciphers, cert_required' do
cached(:chef_run) do
node.override['openstack']['telemetry_metric']['ssl']['enabled'] = true
node.override['openstack']['telemetry_metric']['ssl']['chainfile'] =
'/etc/ceilometer/ssl/certs/chainfile.pem'
node.override['openstack']['telemetry_metric']['ssl']['ciphers'] = 'ciphers_value'
node.override['openstack']['telemetry_metric']['ssl']['cert_required'] = true
runner.converge(described_recipe)
end
it "configures #{file} chainfile when set" do
expect(chef_run).to render_file(file)
.with_content(%r{SSLCertificateChainFile /etc/ceilometer/ssl/certs/chainfile.pem$})
end
it "configures #{file} ciphers when set" do
expect(chef_run).to render_file(file)
.with_content(/SSLCipherSuite ciphers_value$/)
end
it "configures #{file} cert_required set" do
expect(chef_run).to render_file(file)
.with_content(/SSLVerifyClient require$/)
end
end
end
describe 'restart apache' do
it do
expect(chef_run.template('/etc/apache2/sites-available/gnocchi-api.conf')).to \
notify('service[apache2]').to(:restart)
end
it do
expect(chef_run.apache2_site('gnocchi-api')).to notify('service[apache2]').to(:restart).immediately
end
end
end
end
end

View File

@ -1,22 +0,0 @@
require_relative 'spec_helper'
describe 'openstack-telemetry::gnocchi_install' 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 'telemetry-stubs'
it do
expect(chef_run).to upgrade_package %w(openstack-gnocchi-api openstack-gnocchi-metricd)
end
it do
expect(chef_run).to stop_service('openstack-gnocchi-api')
expect(chef_run).to disable_service('openstack-gnocchi-api')
end
end
end
end

View File

@ -1,20 +0,0 @@
require_relative 'spec_helper'
describe 'openstack-telemetry::gnocchi_install' do
describe 'ubuntu' do
let(:runner) { ChefSpec::SoloRunner.new(UBUNTU_OPTS) }
let(:node) { runner.node }
cached(:chef_run) { runner.converge(described_recipe) }
include_context 'telemetry-stubs'
it do
expect(chef_run).to upgrade_package %w(gnocchi-api gnocchi-common gnocchi-metricd python3-gnocchi python3-gnocchiclient)
end
it do
expect(chef_run).to stop_service('gnocchi-api')
expect(chef_run).to disable_service('gnocchi-api')
end
end
end

View File

@ -1,87 +0,0 @@
require_relative 'spec_helper'
describe 'openstack-telemetry::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 'telemetry-stubs'
%w(telemetry telemetry_metric).each do |telemetry_service|
case telemetry_service
when 'telemetry'
service_name = 'ceilometer'
service_type = 'metering'
password = 'ceilometer-pass'
when 'telemetry_metric'
service_name = 'gnocchi'
service_type = 'metric'
password = 'gnocchi-pass'
port = 8041
end
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',
openstack_endpoint_type: 'internalURL',
}
service_user = service_name
url = "http://127.0.0.1:#{port}"
region = 'RegionOne'
project_name = 'service'
role_name = 'admin'
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
unless telemetry_service == 'telemetry'
describe "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
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
end

View File

@ -1,31 +0,0 @@
require_relative 'spec_helper'
describe 'openstack-telemetry::setup' do
describe 'ubuntu' do
let(:runner) { ChefSpec::SoloRunner.new(UBUNTU_OPTS) }
let(:node) { runner.node }
cached(:chef_run) { runner.converge(described_recipe) }
include_context 'telemetry-stubs'
it do
expect(chef_run).to run_execute('ceilometer database migration')
.with(
command: 'ceilometer-upgrade --skip-gnocchi-resource-types --config-file /etc/ceilometer/ceilometer.conf'
)
end
context 'Non-default upgrade_opts' do
cached(:chef_run) do
node.override['openstack']['telemetry']['upgrade_opts'] = ''
runner.converge(described_recipe)
end
it do
expect(chef_run).to run_execute('ceilometer database migration')
.with(
command: 'ceilometer-upgrade --config-file /etc/ceilometer/ceilometer.conf'
)
end
end
end
end

View File

@ -1,106 +0,0 @@
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 'telemetry-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(:memcached_servers).and_return([])
allow_any_instance_of(Chef::Recipe).to receive(:get_password)
.with('db', 'ceilometer')
.and_return('ceilometer-dbpass')
allow_any_instance_of(Chef::Recipe).to receive(:get_password)
.with('db', 'gnocchi')
.and_return('gnocchi-dbpass')
allow_any_instance_of(Chef::Recipe).to receive(:get_password)
.with('db', 'aodh')
.and_return('aodh-dbpass')
allow_any_instance_of(Chef::Recipe).to receive(:get_password)
.with('service', 'openstack-telemetry')
.and_return('ceilometer-pass')
allow_any_instance_of(Chef::Recipe).to receive(:get_password)
.with('service', 'openstack-telemetry_metric')
.and_return('gnocchi-pass')
allow_any_instance_of(Chef::Recipe).to receive(:get_password)
.with('service', 'openstack-aodh')
.and_return('aodh-pass')
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')
.and_return('admin-pass')
allow_any_instance_of(Chef::Recipe).to receive(:rabbit_transport_url)
.with('telemetry')
.and_return('rabbit://guest:mypass@127.0.0.1:5672')
allow_any_instance_of(Chef::Recipe).to receive(:rabbit_transport_url)
.with('aodh')
.and_return('rabbit://guest:mypass@127.0.0.1:5672')
allow(Chef::Application).to receive(:fatal!)
stub_command('/usr/sbin/apache2 -t')
stub_command('/usr/sbin/httpd -t')
# 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(:rabbit_transport_url)
.with('identity')
.and_return('rabbit://openstack:mypass@127.0.0.1:5672')
allow_any_instance_of(Chef::Recipe).to receive(:get_password)
.with('db', 'keystone')
.and_return('keystone-dbpass')
end
end
shared_examples 'expect-runs-common-recipe' do
it 'runs common recipe' do
expect(chef_run).to include_recipe 'openstack-telemetry::common'
end
end

View File

@ -1,107 +0,0 @@
<%= node['openstack']['common']['custom_template_banner'] %>
---
sources:
- name: meter_source
meters:
- "*"
sinks:
- meter_sink
- name: cpu_source
meters:
- "cpu"
sinks:
- cpu_sink
- cpu_delta_sink
- name: disk_source
meters:
- "disk.read.bytes"
- "disk.read.requests"
- "disk.write.bytes"
- "disk.write.requests"
- "disk.device.read.bytes"
- "disk.device.read.requests"
- "disk.device.write.bytes"
- "disk.device.write.requests"
sinks:
- disk_sink
- name: network_source
meters:
- "network.incoming.bytes"
- "network.incoming.packets"
- "network.outgoing.bytes"
- "network.outgoing.packets"
sinks:
- network_sink
sinks:
- name: meter_sink
publishers:
<% @publishers.each do |publisher| %>
- <%= publisher %>
<% end -%>
# All these transformers are deprecated, and will be removed in the future, don't use them.
- name: cpu_sink
transformers:
- name: "rate_of_change"
parameters:
target:
name: "cpu_util"
unit: "%"
type: "gauge"
max: 100
scale: "100.0 / (10**9 * (resource_metadata.cpu_number or 1))"
publishers:
<% @publishers.each do |publisher| %>
- <%= publisher %>
<% end -%>
# All these transformers are deprecated, and will be removed in the future, don't use them.
- name: cpu_delta_sink
transformers:
- name: "delta"
parameters:
target:
name: "cpu.delta"
growth_only: True
publishers:
<% @publishers.each do |publisher| %>
- <%= publisher %>
<% end -%>
# All these transformers are deprecated, and will be removed in the future, don't use them.
- name: disk_sink
transformers:
- name: "rate_of_change"
parameters:
source:
map_from:
name: "(disk\\.device|disk)\\.(read|write)\\.(bytes|requests)"
unit: "(B|request)"
target:
map_to:
name: "\\1.\\2.\\3.rate"
unit: "\\1/s"
type: "gauge"
publishers:
<% @publishers.each do |publisher| %>
- <%= publisher %>
<% end -%>
# All these transformers are deprecated, and will be removed in the future, don't use them.
- name: network_sink
transformers:
- name: "rate_of_change"
parameters:
source:
map_from:
name: "network\\.(incoming|outgoing)\\.(bytes|packets)"
unit: "(B|packet)"
target:
map_to:
name: "network.\\1.\\2.rate"
unit: "\\1/s"
type: "gauge"
publishers:
<% @publishers.each do |publisher| %>
- <%= publisher %>
<% end -%>

View File

@ -1,9 +0,0 @@
<%= node['openstack']['common']['custom_template_banner'] %>
---
sources:
- name: some_pollsters
interval: <%= @interval %>
meters:
<% @meters.each do |meter| -%>
- <%= meter %>
<% end -%>

View File

@ -1,32 +0,0 @@
<%= node["openstack"]["telemetry"]["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
ErrorLogFormat "%{cu}t %M"
ErrorLog <%= @log_dir %>/<%= @daemon_process %>_error.log
CustomLog <%= @log_dir %>/<%= @daemon_process %>_access.log combined
<% if @use_ssl -%>
SSLEngine On
SSLCertificateFile <%= @cert_file %>
SSLCertificateKeyFile <%= @key_file %>
SSLCACertificatePath <%= @ca_certs_path %>
<% if @chain_file %>
SSLCertificateChainFile <%= @chain_file %>
<% end -%>
SSLProtocol <%= @protocol %>
<% if @ciphers -%>
SSLCipherSuite <%= @ciphers %>
<% end -%>
<% if @cert_required -%>
SSLVerifyClient require
<% end -%>
<% end -%>
</VirtualHost>
WSGISocketPrefix <%= @run_dir %>