CentOS 8 support
- Update package names - Migrate to using apache2_mod_wsgi resource and require apache2 ~> 8.6 - Update ChefSpec Depends-On: https://review.opendev.org/c/openstack/cookbook-openstack-identity/+/815147 Change-Id: Iecf9c2a68d3c246412d2a09a7ac0888dd406c268 Signed-off-by: Lance Albertson <lance@osuosl.org>
This commit is contained in:
parent
21424d8868
commit
f04c63bd47
@ -38,7 +38,7 @@ Cookbooks
|
||||
|
||||
The following cookbooks are dependencies:
|
||||
|
||||
- 'apache2', '~> 8.1'
|
||||
- 'apache2', '~> 8.6'
|
||||
- 'openstackclient'
|
||||
- 'openstack-common', '>= 20.0.0'
|
||||
- 'openstack-identity', '>= 20.0.0'
|
||||
|
@ -124,40 +124,83 @@ default['openstack']['telemetry']['polling']['meters'] =
|
||||
end
|
||||
case node['platform_family']
|
||||
when 'rhel'
|
||||
default['openstack']['telemetry']['platform'] = {
|
||||
'common_packages' => %w(openstack-ceilometer-common mod_wsgi),
|
||||
'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' => '',
|
||||
}
|
||||
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'] = {
|
||||
'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',
|
||||
}
|
||||
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'] = {
|
||||
|
@ -9,7 +9,7 @@ version '20.0.0'
|
||||
supports os
|
||||
end
|
||||
|
||||
depends 'apache2', '~> 8.1'
|
||||
depends 'apache2', '~> 8.6'
|
||||
depends 'openstackclient'
|
||||
depends 'openstack-common', '>= 20.0.0'
|
||||
depends 'openstack-identity', '>= 20.0.0'
|
||||
|
@ -102,7 +102,7 @@ else
|
||||
end
|
||||
end
|
||||
|
||||
apache2_module 'wsgi'
|
||||
apache2_mod_wsgi 'aodh'
|
||||
apache2_module 'ssl' if node['openstack']['aodh']['ssl']['enabled']
|
||||
|
||||
# create the aodh-api apache directory
|
||||
|
@ -127,7 +127,7 @@ else
|
||||
end
|
||||
end
|
||||
|
||||
apache2_module 'wsgi'
|
||||
apache2_mod_wsgi 'gnocchi'
|
||||
apache2_module 'ssl' if node['openstack']['telemetry_metric']['ssl']['enabled']
|
||||
|
||||
# create the gnocchi-api apache directory
|
||||
|
@ -1,20 +1,22 @@
|
||||
require_relative 'spec_helper'
|
||||
|
||||
describe 'openstack-telemetry::agent-central' do
|
||||
describe 'rhel' do
|
||||
let(:runner) { ChefSpec::SoloRunner.new(REDHAT_OPTS) }
|
||||
let(:node) { runner.node }
|
||||
cached(:chef_run) { runner.converge(described_recipe) }
|
||||
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'
|
||||
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 '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'
|
||||
it 'starts the agent-central service' do
|
||||
expect(chef_run).to start_service 'openstack-ceilometer-central'
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -1,20 +1,22 @@
|
||||
require_relative 'spec_helper'
|
||||
|
||||
describe 'openstack-telemetry::agent-compute' do
|
||||
describe 'rhel' do
|
||||
let(:runner) { ChefSpec::SoloRunner.new(REDHAT_OPTS) }
|
||||
let(:node) { runner.node }
|
||||
cached(:chef_run) { runner.converge(described_recipe) }
|
||||
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'
|
||||
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 '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')
|
||||
it 'starts ceilometer-agent-compute service' do
|
||||
expect(chef_run).to start_service('openstack-ceilometer-compute')
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -1,20 +1,22 @@
|
||||
require_relative 'spec_helper'
|
||||
|
||||
describe 'openstack-telemetry::agent-notification' do
|
||||
describe 'rhel' do
|
||||
let(:runner) { ChefSpec::SoloRunner.new(REDHAT_OPTS) }
|
||||
let(:node) { runner.node }
|
||||
cached(:chef_run) { runner.converge(described_recipe) }
|
||||
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'
|
||||
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 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'
|
||||
it 'starts the agent-notification service' do
|
||||
expect(chef_run).to start_service 'openstack-ceilometer-notification'
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -1,27 +1,36 @@
|
||||
require_relative 'spec_helper'
|
||||
|
||||
describe 'openstack-telemetry::aodh' do
|
||||
describe 'rhel' do
|
||||
let(:runner) { ChefSpec::SoloRunner.new(REDHAT_OPTS) }
|
||||
let(:node) { runner.node }
|
||||
cached(:chef_run) { runner.converge(described_recipe) }
|
||||
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_context 'telemetry-stubs'
|
||||
|
||||
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
|
||||
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 '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]')
|
||||
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
|
||||
|
@ -17,7 +17,7 @@ describe 'openstack-telemetry::aodh' do
|
||||
end
|
||||
|
||||
it do
|
||||
expect(chef_run).to enable_apache2_module('wsgi')
|
||||
expect(chef_run).to create_apache2_mod_wsgi 'aodh'
|
||||
end
|
||||
|
||||
it do
|
||||
|
@ -1,19 +1,28 @@
|
||||
require_relative 'spec_helper'
|
||||
|
||||
describe 'openstack-telemetry::common' do
|
||||
describe 'rhel' do
|
||||
let(:runner) { ChefSpec::SoloRunner.new(REDHAT_OPTS) }
|
||||
let(:node) { runner.node }
|
||||
cached(:chef_run) { runner.converge(described_recipe) }
|
||||
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_context 'telemetry-stubs'
|
||||
|
||||
it 'installs mysql python packages by default' do
|
||||
expect(chef_run).to upgrade_package 'MySQL-python'
|
||||
end
|
||||
case p
|
||||
when REDHAT_7
|
||||
it do
|
||||
expect(chef_run).to upgrade_package 'MySQL-python'
|
||||
end
|
||||
when REDHAT_8
|
||||
it do
|
||||
expect(chef_run).to upgrade_package 'python3-PyMySQL'
|
||||
end
|
||||
end
|
||||
|
||||
it 'installs the common packages' do
|
||||
expect(chef_run).to upgrade_package %w(openstack-ceilometer-common mod_wsgi)
|
||||
it 'installs the common packages' do
|
||||
expect(chef_run).to upgrade_package %w(openstack-ceilometer-common)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -1,21 +1,23 @@
|
||||
require_relative 'spec_helper'
|
||||
|
||||
describe 'openstack-telemetry::gnocchi_configure' do
|
||||
describe 'rhel' do
|
||||
let(:runner) { ChefSpec::SoloRunner.new(REDHAT_OPTS) }
|
||||
let(:node) { runner.node }
|
||||
cached(:chef_run) { runner.converge(described_recipe) }
|
||||
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_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'
|
||||
)
|
||||
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
|
||||
|
@ -13,7 +13,7 @@ describe 'openstack-telemetry::gnocchi_configure' do
|
||||
end
|
||||
|
||||
it do
|
||||
expect(chef_run).to enable_apache2_module('wsgi')
|
||||
expect(chef_run).to create_apache2_mod_wsgi 'gnocchi'
|
||||
end
|
||||
|
||||
it do
|
||||
|
@ -1,20 +1,22 @@
|
||||
require_relative 'spec_helper'
|
||||
|
||||
describe 'openstack-telemetry::gnocchi_install' do
|
||||
describe 'redhat' do
|
||||
let(:runner) { ChefSpec::SoloRunner.new(REDHAT_OPTS) }
|
||||
let(:node) { runner.node }
|
||||
cached(:chef_run) { runner.converge(described_recipe) }
|
||||
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_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 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')
|
||||
it do
|
||||
expect(chef_run).to stop_service('openstack-gnocchi-api')
|
||||
expect(chef_run).to disable_service('openstack-gnocchi-api')
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -9,10 +9,21 @@ RSpec.configure do |config|
|
||||
config.file_cache_path = '/var/chef/cache'
|
||||
end
|
||||
|
||||
REDHAT_OPTS = {
|
||||
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',
|
||||
|
Loading…
Reference in New Issue
Block a user