Remove deprecated api service
The API service for Ceilometer was deprecated in Ocata [1] and apparently we missed that. This removes all references to the API service which is no longer needed. [1] https://docs.openstack.org/releasenotes/ceilometer/ocata.html#deprecation-notes Change-Id: I7a888a4aaadaa8213d6763854b39d78910fad0db Signed-off-by: Lance Albertson <lance@osuosl.org>
This commit is contained in:
parent
fd3d9ceb62
commit
0c072b88b9
|
@ -67,9 +67,6 @@ Recipes
|
|||
## agent-notification
|
||||
- Installs agent notification service.
|
||||
|
||||
## api
|
||||
- Installs API service.
|
||||
|
||||
## client
|
||||
- Install the client packages
|
||||
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
default['openstack']['telemetry']['conf_secrets'] = {}
|
||||
|
||||
default['openstack']['telemetry']['conf'].tap do |conf|
|
||||
# [DEFAULT] section
|
||||
conf['DEFAULT']['meter_dispatchers'] = 'gnocchi'
|
||||
# [keystone_authtoken] section
|
||||
conf['keystone_authtoken']['username'] = 'ceilometer'
|
||||
conf['keystone_authtoken']['project_name'] = 'service'
|
||||
|
|
|
@ -32,7 +32,6 @@ default['openstack']['telemetry']['custom_template_banner'] = '
|
|||
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']['port'] = 8777
|
||||
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
|
||||
|
@ -40,7 +39,6 @@ default['openstack']['telemetry']['custom_template_banner'] = '
|
|||
end
|
||||
default['openstack']['bind_service']['all'][ts]['host'] = '127.0.0.1'
|
||||
end
|
||||
default['openstack']['bind_service']['all']['telemetry']['port'] = 8777
|
||||
default['openstack']['bind_service']['all']['telemetry_metric']['port'] = 8041
|
||||
default['openstack']['bind_service']['all']['aodh']['port'] = 8042
|
||||
|
||||
|
@ -71,7 +69,7 @@ default['openstack']['aodh']['service_role'] = 'admin'
|
|||
|
||||
default['openstack']['telemetry_metric']['gnocchi-upgrade-options'] = ''
|
||||
|
||||
%w(telemetry telemetry_metric aodh).each do |ts|
|
||||
%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
|
||||
|
@ -108,8 +106,6 @@ when 'rhel'
|
|||
'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/share/gnocchi-common/app.wsgi',
|
||||
'api_packages' => ['openstack-ceilometer-api'],
|
||||
'api_service' => 'openstack-ceilometer-api',
|
||||
'collector_packages' => ['openstack-ceilometer-collector'],
|
||||
'collector_service' => 'openstack-ceilometer-collector',
|
||||
'package_overrides' => '',
|
||||
|
@ -126,7 +122,7 @@ when 'rhel'
|
|||
when 'debian'
|
||||
default['openstack']['telemetry']['platform'] = {
|
||||
'common_packages' => ['ceilometer-common'],
|
||||
'gnocchi_packages' => ['python-gnocchi', 'gnocchi-common', 'gnocchi-api', 'gnocchi-metricd', 'python-gnocchiclient'],
|
||||
'gnocchi_packages' => ['python-gnocchi', 'gnocchi-common', 'gnocchi-metricd', 'python-gnocchiclient'],
|
||||
'gnocchi-api_service' => 'gnocchi-api',
|
||||
'gnocchi-metricd_service' => 'gnocchi-metricd',
|
||||
'agent_central_packages' => ['ceilometer-agent-central'],
|
||||
|
@ -136,9 +132,7 @@ when 'debian'
|
|||
'agent_notification_packages' => ['ceilometer-agent-notification'],
|
||||
'agent_notification_service' => 'ceilometer-agent-notification',
|
||||
'ceilometer-api_wsgi_file' => '/usr/lib/python2.7/dist-packages/ceilometer/api/app.wsgi',
|
||||
'gnocchi-api_wsgi_file' => '/usr/share/gnocchi-common/app.wsgi',
|
||||
'api_packages' => ['ceilometer-api'],
|
||||
'api_service' => 'ceilometer-api',
|
||||
'gnocchi-api_wsgi_file' => '/usr/lib/python2.7/dist-packages/gnocchi/rest/wsgi.py',
|
||||
'collector_packages' => ['ceilometer-collector', 'python-mysqldb'],
|
||||
'collector_service' => 'ceilometer-collector',
|
||||
'package_overrides' => '',
|
||||
|
|
100
recipes/api.rb
100
recipes/api.rb
|
@ -1,100 +0,0 @@
|
|||
# encoding: UTF-8
|
||||
#
|
||||
# Cookbook Name:: openstack-telemetry
|
||||
# Recipe:: api
|
||||
#
|
||||
# Copyright 2013, AT&T Services, Inc.
|
||||
# Copyright 2013, Craig Tracey <craigtracey@gmail.com>
|
||||
# Copyright 2013, SUSE Linux GmbH
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
require 'addressable'
|
||||
|
||||
# load the methods defined in cookbook-openstack-common libraries
|
||||
class ::Chef::Recipe
|
||||
include ::Openstack
|
||||
end
|
||||
|
||||
# include_recipe 'openstack-telemetry::common'
|
||||
|
||||
platform = node['openstack']['telemetry']['platform']
|
||||
platform['api_packages'].each do |pkg|
|
||||
package pkg do
|
||||
options platform['package_overrides']
|
||||
action :upgrade
|
||||
end
|
||||
end
|
||||
# stop and disable the service ceilometer-api itself, since it should be run inside
|
||||
# of apache
|
||||
service platform['api_service'] do
|
||||
action [:stop, :disable]
|
||||
end
|
||||
|
||||
bind_service = node['openstack']['bind_service']['all']['telemetry']
|
||||
bind_service_address = bind_address bind_service
|
||||
#### Start of Apache specific work
|
||||
|
||||
# configure attributes for apache2 cookbook to align with openstack settings
|
||||
apache_listen = Array(node['apache']['listen']) # include already defined listen attributes
|
||||
# Remove the default apache2 cookbook port, as that is also the default for horizon, but with
|
||||
# a different address syntax. *:80 vs 0.0.0.0:80
|
||||
apache_listen -= ['*:80']
|
||||
apache_listen += ["#{bind_service_address}:#{bind_service['port']}"]
|
||||
node.normal['apache']['listen'] = apache_listen.uniq
|
||||
|
||||
# include the apache2 default recipe and the recipes for mod_wsgi
|
||||
include_recipe 'apache2'
|
||||
include_recipe 'apache2::mod_wsgi'
|
||||
# include the apache2 mod_ssl recipe if ssl is enabled for identity
|
||||
include_recipe 'apache2::mod_ssl' if node['openstack']['telemetry']['ssl']['enabled']
|
||||
|
||||
# create the ceilometer-api apache directory
|
||||
ceilometer_apache_dir = "#{node['apache']['docroot_dir']}/ceilometer"
|
||||
directory ceilometer_apache_dir do
|
||||
owner 'root'
|
||||
group 'root'
|
||||
mode 0o0755
|
||||
end
|
||||
|
||||
ceilometer_server_entry = "#{ceilometer_apache_dir}/app"
|
||||
# Note: Using lazy here as the wsgi file is not available until after
|
||||
# the ceilometer-api package is installed during execution phase.
|
||||
file ceilometer_server_entry do
|
||||
content lazy { IO.read(platform['ceilometer-api_wsgi_file']) }
|
||||
owner 'root'
|
||||
group 'root'
|
||||
mode 0o0755
|
||||
end
|
||||
|
||||
web_app 'ceilometer-api' do
|
||||
template 'wsgi-template.conf.erb'
|
||||
daemon_process 'ceilometer-api'
|
||||
server_host bind_service['host']
|
||||
server_port bind_service['port']
|
||||
server_entry ceilometer_server_entry
|
||||
run_dir node['apache']['run_dir']
|
||||
log_dir node['apache']['log_dir']
|
||||
log_debug node['openstack']['telemetry']['debug']
|
||||
user node['openstack']['telemetry']['user']
|
||||
group node['openstack']['telemetry']['group']
|
||||
use_ssl node['openstack']['telemetry']['ssl']['enabled']
|
||||
cert_file node['openstack']['telemetry']['ssl']['certfile']
|
||||
chain_file node['openstack']['telemetry']['ssl']['chainfile']
|
||||
key_file node['openstack']['telemetry']['ssl']['keyfile']
|
||||
ca_certs_path node['openstack']['telemetry']['ssl']['ca_certs_path']
|
||||
cert_required node['openstack']['telemetry']['ssl']['cert_required']
|
||||
protocol node['openstack']['telemetry']['ssl']['protocol']
|
||||
ciphers node['openstack']['telemetry']['ssl']['ciphers']
|
||||
end
|
|
@ -50,8 +50,6 @@ end
|
|||
|
||||
db_user = node['openstack']['db']['telemetry']['username']
|
||||
db_pass = get_password 'db', 'ceilometer'
|
||||
bind_service = node['openstack']['bind_service']['all']['telemetry']
|
||||
bind_service_address = bind_address bind_service
|
||||
|
||||
# define secrets that are needed in the ceilometer.conf
|
||||
node.default['openstack']['telemetry']['conf_secrets'].tap do |conf_secrets|
|
||||
|
@ -67,8 +65,6 @@ identity_endpoint = public_endpoint 'identity'
|
|||
auth_url = ::URI.decode identity_endpoint.to_s
|
||||
|
||||
node.default['openstack']['telemetry']['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['dispatcher_gnocchi']['url'] = public_endpoint 'telemetry_metric'
|
||||
|
|
|
@ -1,17 +0,0 @@
|
|||
# encoding: UTF-8
|
||||
|
||||
require_relative 'spec_helper'
|
||||
|
||||
describe 'openstack-telemetry::api' do
|
||||
describe 'rhel' do
|
||||
let(:runner) { ChefSpec::SoloRunner.new(REDHAT_OPTS) }
|
||||
let(:node) { runner.node }
|
||||
let(:chef_run) { runner.converge(described_recipe) }
|
||||
|
||||
include_context 'telemetry-stubs'
|
||||
|
||||
it 'installs the api package' do
|
||||
expect(chef_run).to upgrade_package 'openstack-ceilometer-api'
|
||||
end
|
||||
end
|
||||
end
|
125
spec/api_spec.rb
125
spec/api_spec.rb
|
@ -1,125 +0,0 @@
|
|||
# encoding: UTF-8
|
||||
|
||||
require_relative 'spec_helper'
|
||||
|
||||
describe 'openstack-telemetry::api' do
|
||||
describe 'ubuntu' do
|
||||
let(:runner) { ChefSpec::SoloRunner.new(UBUNTU_OPTS) }
|
||||
let(:node) { runner.node }
|
||||
let(:chef_run) { runner.converge(described_recipe) }
|
||||
|
||||
include_context 'telemetry-stubs'
|
||||
|
||||
it 'installs the api package' do
|
||||
expect(chef_run).to upgrade_package 'ceilometer-api'
|
||||
end
|
||||
it do
|
||||
expect(chef_run).to stop_service('ceilometer-api')
|
||||
expect(chef_run).to disable_service('ceilometer-api')
|
||||
end
|
||||
|
||||
describe 'apache recipes' do
|
||||
it 'include apache recipes' do
|
||||
expect(chef_run).to include_recipe('apache2')
|
||||
expect(chef_run).to include_recipe('apache2::mod_wsgi')
|
||||
expect(chef_run).not_to include_recipe('apache2::mod_ssl')
|
||||
end
|
||||
|
||||
it 'include apache recipes' do
|
||||
node.override['openstack']['telemetry']['ssl']['enabled'] = true
|
||||
expect(chef_run).to include_recipe('apache2::mod_ssl')
|
||||
end
|
||||
end
|
||||
|
||||
it 'creates directory /var/www/html/ceilometer' do
|
||||
expect(chef_run).to create_directory('/var/www/html/ceilometer').with(
|
||||
user: 'root',
|
||||
group: 'root',
|
||||
mode: 0o0755
|
||||
)
|
||||
end
|
||||
|
||||
it 'creates wsgi file' do
|
||||
expect(chef_run).to create_file('/var/www/html/ceilometer/app').with(
|
||||
user: 'root',
|
||||
group: 'root',
|
||||
mode: 0o0755
|
||||
)
|
||||
end
|
||||
|
||||
describe 'apache wsgi' do
|
||||
file = '/etc/apache2/sites-available/ceilometer-api.conf'
|
||||
it "creates #{file}" do
|
||||
expect(chef_run).to create_template(file).with(
|
||||
user: 'root',
|
||||
group: 'root',
|
||||
mode: '0644'
|
||||
)
|
||||
end
|
||||
|
||||
it "configures #{file} common lines" do
|
||||
node.override['openstack']['telemetry']['custom_template_banner'] = 'custom_template_banner_value'
|
||||
[/user=ceilometer/,
|
||||
/group=ceilometer/,
|
||||
%r{^ ErrorLog /var/log/apache2/ceilometer-api_error.log$},
|
||||
%r{^ CustomLog /var/log/apache2/ceilometer-api_access.log}].each do |line|
|
||||
expect(chef_run).to render_file(file).with_content(line)
|
||||
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
|
||||
before do
|
||||
node.override['openstack']['telemetry']['ssl']['enabled'] = true
|
||||
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
|
||||
it "configures #{file} chainfile when set" do
|
||||
node.override['openstack']['telemetry']['ssl']['chainfile'] = '/etc/ceilometer/ssl/certs/chainfile.pem'
|
||||
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
|
||||
node.override['openstack']['telemetry']['ssl']['ciphers'] = 'ciphers_value'
|
||||
expect(chef_run).to render_file(file)
|
||||
.with_content(/^ SSLCipherSuite ciphers_value$/)
|
||||
end
|
||||
it "configures #{file} cert_required set" do
|
||||
node.override['openstack']['telemetry']['ssl']['cert_required'] = true
|
||||
expect(chef_run).to render_file(file)
|
||||
.with_content(/^ SSLVerifyClient require$/)
|
||||
end
|
||||
end
|
||||
|
||||
describe 'ceilometer-api WSGI app' do
|
||||
it 'configures required lines' do
|
||||
[/^<VirtualHost 127.0.0.1:8777>$/,
|
||||
/^ WSGIDaemonProcess ceilometer-api/,
|
||||
/^ WSGIProcessGroup ceilometer-api$/,
|
||||
%r{^ WSGIScriptAlias / /var/www/html/ceilometer/app$}].each do |line|
|
||||
expect(chef_run).to render_file('/etc/apache2/sites-available/ceilometer-api.conf').with_content(line)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -51,11 +51,6 @@ describe 'openstack-telemetry::common' do
|
|||
)
|
||||
end
|
||||
|
||||
it do
|
||||
expect(chef_run).to render_config_file(file.name)
|
||||
.with_section_content('DEFAULT', /^meter_dispatchers = gnocchi$/)
|
||||
end
|
||||
|
||||
it do
|
||||
[
|
||||
/^username = ceilometer$/,
|
||||
|
@ -89,16 +84,6 @@ describe 'openstack-telemetry::common' do
|
|||
end
|
||||
end
|
||||
|
||||
it do
|
||||
[
|
||||
/^host = 127\.0\.0\.1$/,
|
||||
/^port = 8777$/,
|
||||
].each do |line|
|
||||
expect(chef_run).to render_config_file(file.name)
|
||||
.with_section_content('api', line)
|
||||
end
|
||||
end
|
||||
|
||||
it do
|
||||
[
|
||||
%r{url = http://127\.0\.0\.1:8041},
|
||||
|
|
|
@ -10,10 +10,6 @@ describe 'openstack-telemetry::gnocchi_install' do
|
|||
|
||||
include_context 'telemetry-stubs'
|
||||
|
||||
it do
|
||||
expect(chef_run).to upgrade_package 'gnocchi-api'
|
||||
end
|
||||
|
||||
it do
|
||||
expect(chef_run).to stop_service('gnocchi-api')
|
||||
expect(chef_run).to disable_service('gnocchi-api')
|
||||
|
|
|
@ -16,7 +16,6 @@ describe 'openstack-telemetry::identity_registration' do
|
|||
service_name = 'ceilometer'
|
||||
service_type = 'metering'
|
||||
password = 'ceilometer-pass'
|
||||
port = 8777
|
||||
when 'telemetry_metric'
|
||||
service_name = 'gnocchi'
|
||||
service_type = 'metric'
|
||||
|
@ -56,18 +55,20 @@ describe 'openstack-telemetry::identity_registration' do
|
|||
)
|
||||
end
|
||||
|
||||
context "registers #{service_name} endpoint" do
|
||||
%w(internal public).each do |interface|
|
||||
it "#{interface} endpoint with default values" do
|
||||
expect(chef_run).to create_openstack_endpoint(
|
||||
service_type
|
||||
).with(
|
||||
service_name: service_name,
|
||||
# interface: interface,
|
||||
url: url,
|
||||
region: region,
|
||||
connection_params: connection_params
|
||||
)
|
||||
unless telemetry_service == 'telemetry'
|
||||
context "registers #{service_name} endpoint" do
|
||||
%w(internal public).each do |interface|
|
||||
it "#{interface} endpoint with default values" do
|
||||
expect(chef_run).to create_openstack_endpoint(
|
||||
service_type
|
||||
).with(
|
||||
service_name: service_name,
|
||||
# interface: interface,
|
||||
url: url,
|
||||
region: region,
|
||||
connection_params: connection_params
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue