stop managing eventlet service on RedHat

RedHat packaging dropped the eventlet service (openstack-keystone) so we
no longer need to manage it (we used to stop the service before starting
httpd to make sure apache can start without binding issue).

So we still maintain the service stop for Debian & Ubuntu, since they
sitll provide the scripts.
Once they'll drop it, we'll drop the Service resource and deprecate
keystone::service class that will be useless.

Change-Id: Iecef6f2829ef4bf9162e77ef024d53eedf485726
This commit is contained in:
Emilien Macchi 2016-05-12 16:48:01 -04:00
parent 5f740be73d
commit cb1ed62563
2 changed files with 37 additions and 12 deletions
manifests
spec/classes

@ -925,16 +925,18 @@ class keystone(
warning('Keystone under Eventlet has been deprecated during the Kilo cycle. Support for deploying under eventlet will be dropped as of the M-release of OpenStack.')
} elsif $service_name == 'httpd' {
include ::apache::params
class { '::keystone::service':
ensure => 'stopped',
service_name => $::keystone::params::service_name,
enable => false,
validate => false,
}
$service_name_real = $::apache::params::service_name
# leave this here because Ubuntu packages will start Keystone and we need it stopped
# before apache can run
Service['keystone'] -> Service[$service_name_real]
if $::osfamily == 'Debian' {
class { '::keystone::service':
ensure => 'stopped',
service_name => $::keystone::params::service_name,
enable => false,
validate => false,
}
# leave this here because Ubuntu packages will start Keystone and we need it stopped
# before apache can run
Service['keystone'] -> Service[$service_name_real]
}
} else {
fail('Invalid service_name. Either keystone/openstack-keystone for running as a standalone service, or httpd for being run by a httpd server')
}

@ -270,7 +270,7 @@ describe 'keystone' do
end
end
shared_examples_for "when using default class parameters for httpd" do
shared_examples_for "when using default class parameters for httpd on Debian" do
let :params do
httpd_params
end
@ -299,6 +299,29 @@ describe 'keystone' do
) }
end
shared_examples_for "when using default class parameters for httpd on RedHat" do
let :params do
httpd_params
end
let :pre_condition do
'include ::keystone::wsgi::apache'
end
it_configures 'core keystone examples', httpd_params
it do
expect {
is_expected.to contain_service(platform_parameters[:service_name]).with('ensure' => 'running')
}.to raise_error(RSpec::Expectations::ExpectationNotMetError, /expected that the catalogue would contain Service\[#{platform_parameters[:service_name]}\]/)
end
it { is_expected.to contain_service('httpd').with_before(/Anchor\[keystone::service::end\]/) }
it { is_expected.to contain_exec('restart_keystone').with(
'command' => "service #{platform_parameters[:httpd_service_name]} restart",
) }
end
describe 'when using invalid service name for keystone' do
let (:params) { {'service_name' => 'foo'}.merge(default_params) }
@ -918,7 +941,7 @@ describe 'keystone' do
}
end
it_configures 'when using default class parameters for httpd'
it_configures 'when using default class parameters for httpd on RedHat'
it_configures 'when configuring default domain'
end
@ -938,7 +961,7 @@ describe 'keystone' do
}
end
it_configures 'when using default class parameters for httpd'
it_configures 'when using default class parameters for httpd on Debian'
it_configures 'when configuring default domain'
end