Browse Source

Merge "Autonatically set memcache_servers for keystone cache"

changes/94/718194/1
Zuul 1 year ago
committed by Gerrit Code Review
parent
commit
93c1e91e22
  1. 6
      manifests/profile/base/keystone.pp
  2. 10
      spec/classes/tripleo_profile_base_keystone_spec.rb

6
manifests/profile/base/keystone.pp

@ -225,6 +225,8 @@ class tripleo::profile::base::keystone (
if $step >= 4 or ( $step >= 3 and $sync_db ) {
$oslomsg_rpc_use_ssl_real = sprintf('%s', bool2num(str2bool($oslomsg_rpc_use_ssl)))
$oslomsg_notify_use_ssl_real = sprintf('%s', bool2num(str2bool($oslomsg_notify_use_ssl)))
$memcached_servers = suffix(any2array(normalize_ip_for_uri($memcached_ips)), ':11211')
class { 'keystone':
sync_db => $sync_db,
enable_bootstrap => $sync_db,
@ -246,7 +248,8 @@ class tripleo::profile::base::keystone (
}),
notification_topics => union($ceilometer_notification_topics,
$barbican_notification_topics,
$extra_notification_topics)
$extra_notification_topics),
cache_memcache_servers => $memcached_servers
}
if 'amqp' in [$oslomsg_rpc_proto, $oslomsg_notify_proto]{
@ -279,7 +282,6 @@ class tripleo::profile::base::keystone (
}
if $keystone_openidc_enabled {
$memcached_servers = suffix(any2array(normalize_ip_for_uri($memcached_ips)), ':11211')
class { 'keystone::federation::openidc':
memcached_servers => $memcached_servers,

10
spec/classes/tripleo_profile_base_keystone_spec.rb

@ -30,6 +30,7 @@ describe 'tripleo::profile::base::keystone' do
:oslomsg_notify_username => 'keystone2',
:oslomsg_notify_password => 'baa',
:oslomsg_notify_port => '5678',
:memcached_ips => [ '192.168.0.3', '192.168.0.4', '192.168.0.5' ],
}
end
@ -62,7 +63,8 @@ describe 'tripleo::profile::base::keystone' do
it 'should trigger complete configuration' do
is_expected.to contain_class('keystone').with(
:default_transport_url => 'rabbit://keystone1:foo@192.168.0.1:1234/?ssl=0',
:notification_transport_url => 'rabbit://keystone2:baa@192.168.0.2:5678/?ssl=0'
:notification_transport_url => 'rabbit://keystone2:baa@192.168.0.2:5678/?ssl=0',
:cache_memcache_servers => [ '192.168.0.3:11211', '192.168.0.4:11211', '192.168.0.5:11211' ],
)
is_expected.to contain_class('keystone::config')
is_expected.to contain_class('keystone::logging')
@ -108,7 +110,8 @@ describe 'tripleo::profile::base::keystone' do
it 'should trigger keystone configuration' do
is_expected.to contain_class('keystone').with(
:default_transport_url => 'rabbit://keystone1:foo@192.168.0.1:1234/?ssl=0',
:notification_transport_url => 'rabbit://keystone2:baa@192.168.0.2:5678/?ssl=0'
:notification_transport_url => 'rabbit://keystone2:baa@192.168.0.2:5678/?ssl=0',
:cache_memcache_servers => [ '192.168.0.3:11211', '192.168.0.4:11211', '192.168.0.5:11211' ],
)
is_expected.to contain_class('keystone::config')
is_expected.to contain_class('keystone::logging')
@ -134,7 +137,8 @@ describe 'tripleo::profile::base::keystone' do
it 'should trigger keystone configuration' do
is_expected.to contain_class('keystone').with(
:default_transport_url => 'rabbit://keystone1:foo@192.168.0.1:1234/?ssl=0',
:notification_transport_url => 'rabbit://keystone2:baa@192.168.0.2:5678/?ssl=0'
:notification_transport_url => 'rabbit://keystone2:baa@192.168.0.2:5678/?ssl=0',
:cache_memcache_servers => [ '192.168.0.3:11211', '192.168.0.4:11211', '192.168.0.5:11211' ],
)
is_expected.to contain_class('keystone::config')
is_expected.to contain_class('keystone::logging')

Loading…
Cancel
Save