Merge "Move rabbit/kombu settings to oslo_messaging_rabbit section"

This commit is contained in:
Jenkins 2015-06-09 17:13:14 +00:00 committed by Gerrit Code Review
commit 9f8e0b6f5c
2 changed files with 78 additions and 78 deletions

View File

@ -302,65 +302,65 @@ class heat(
if $rpc_backend == 'heat.openstack.common.rpc.impl_kombu' { if $rpc_backend == 'heat.openstack.common.rpc.impl_kombu' {
if $rabbit_hosts { if $rabbit_hosts {
heat_config { 'DEFAULT/rabbit_host': ensure => absent } heat_config { 'oslo_messaging_rabbit/rabbit_host': ensure => absent }
heat_config { 'DEFAULT/rabbit_port': ensure => absent } heat_config { 'oslo_messaging_rabbit/rabbit_port': ensure => absent }
heat_config { 'DEFAULT/rabbit_hosts': heat_config { 'oslo_messaging_rabbit/rabbit_hosts':
value => join($rabbit_hosts, ',') value => join($rabbit_hosts, ',')
} }
} else { } else {
heat_config { 'DEFAULT/rabbit_host': value => $rabbit_host } heat_config { 'oslo_messaging_rabbit/rabbit_host': value => $rabbit_host }
heat_config { 'DEFAULT/rabbit_port': value => $rabbit_port } heat_config { 'oslo_messaging_rabbit/rabbit_port': value => $rabbit_port }
heat_config { 'DEFAULT/rabbit_hosts': heat_config { 'oslo_messaging_rabbit/rabbit_hosts':
value => "${rabbit_host}:${rabbit_port}" value => "${rabbit_host}:${rabbit_port}"
} }
} }
if size($rabbit_hosts) > 1 { if size($rabbit_hosts) > 1 {
heat_config { 'DEFAULT/rabbit_ha_queues': value => true } heat_config { 'oslo_messaging_rabbit/rabbit_ha_queues': value => true }
} else { } else {
heat_config { 'DEFAULT/rabbit_ha_queues': value => false } heat_config { 'oslo_messaging_rabbit/rabbit_ha_queues': value => false }
} }
heat_config { heat_config {
'DEFAULT/rabbit_userid' : value => $rabbit_userid; 'oslo_messaging_rabbit/rabbit_userid' : value => $rabbit_userid;
'DEFAULT/rabbit_password' : value => $rabbit_password, secret => true; 'oslo_messaging_rabbit/rabbit_password' : value => $rabbit_password, secret => true;
'DEFAULT/rabbit_virtual_host' : value => $rabbit_virtual_host; 'oslo_messaging_rabbit/rabbit_virtual_host' : value => $rabbit_virtual_host;
'DEFAULT/rabbit_use_ssl' : value => $rabbit_use_ssl; 'oslo_messaging_rabbit/rabbit_use_ssl' : value => $rabbit_use_ssl;
'DEFAULT/amqp_durable_queues' : value => $amqp_durable_queues; 'DEFAULT/amqp_durable_queues' : value => $amqp_durable_queues;
} }
if $rabbit_use_ssl { if $rabbit_use_ssl {
if $kombu_ssl_ca_certs { if $kombu_ssl_ca_certs {
heat_config { 'DEFAULT/kombu_ssl_ca_certs': value => $kombu_ssl_ca_certs; } heat_config { 'oslo_messaging_rabbit/kombu_ssl_ca_certs': value => $kombu_ssl_ca_certs; }
} else { } else {
heat_config { 'DEFAULT/kombu_ssl_ca_certs': ensure => absent; } heat_config { 'oslo_messaging_rabbit/kombu_ssl_ca_certs': ensure => absent; }
} }
if $kombu_ssl_certfile or $kombu_ssl_keyfile { if $kombu_ssl_certfile or $kombu_ssl_keyfile {
heat_config { heat_config {
'DEFAULT/kombu_ssl_certfile': value => $kombu_ssl_certfile; 'oslo_messaging_rabbit/kombu_ssl_certfile': value => $kombu_ssl_certfile;
'DEFAULT/kombu_ssl_keyfile': value => $kombu_ssl_keyfile; 'oslo_messaging_rabbit/kombu_ssl_keyfile': value => $kombu_ssl_keyfile;
} }
} else { } else {
heat_config { heat_config {
'DEFAULT/kombu_ssl_certfile': ensure => absent; 'oslo_messaging_rabbit/kombu_ssl_certfile': ensure => absent;
'DEFAULT/kombu_ssl_keyfile': ensure => absent; 'oslo_messaging_rabbit/kombu_ssl_keyfile': ensure => absent;
} }
} }
if $kombu_ssl_version { if $kombu_ssl_version {
heat_config { 'DEFAULT/kombu_ssl_version': value => $kombu_ssl_version; } heat_config { 'oslo_messaging_rabbit/kombu_ssl_version': value => $kombu_ssl_version; }
} else { } else {
heat_config { 'DEFAULT/kombu_ssl_version': ensure => absent; } heat_config { 'oslo_messaging_rabbit/kombu_ssl_version': ensure => absent; }
} }
} else { } else {
heat_config { heat_config {
'DEFAULT/kombu_ssl_version': ensure => absent; 'oslo_messaging_rabbit/kombu_ssl_version': ensure => absent;
'DEFAULT/kombu_ssl_ca_certs': ensure => absent; 'oslo_messaging_rabbit/kombu_ssl_ca_certs': ensure => absent;
'DEFAULT/kombu_ssl_certfile': ensure => absent; 'oslo_messaging_rabbit/kombu_ssl_certfile': ensure => absent;
'DEFAULT/kombu_ssl_keyfile': ensure => absent; 'oslo_messaging_rabbit/kombu_ssl_keyfile': ensure => absent;
} }
} }

View File

@ -180,58 +180,58 @@ describe 'heat' do
shared_examples_for 'rabbit without HA support (with backward compatibility)' do shared_examples_for 'rabbit without HA support (with backward compatibility)' do
it 'configures rabbit' do it 'configures rabbit' do
is_expected.to contain_heat_config('DEFAULT/rabbit_userid').with_value( params[:rabbit_userid] ) is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_userid').with_value( params[:rabbit_userid] )
is_expected.to contain_heat_config('DEFAULT/rabbit_password').with_value( params[:rabbit_password] ) is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_password').with_value( params[:rabbit_password] )
is_expected.to contain_heat_config('DEFAULT/rabbit_password').with_secret( true ) is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_password').with_secret( true )
is_expected.to contain_heat_config('DEFAULT/rabbit_virtual_host').with_value( params[:rabbit_virtual_host] ) is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_virtual_host').with_value( params[:rabbit_virtual_host] )
is_expected.to contain_heat_config('DEFAULT/rabbit_use_ssl').with_value(false) is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_use_ssl').with_value(false)
is_expected.to contain_heat_config('DEFAULT/kombu_ssl_ca_certs').with_ensure('absent') is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_ssl_ca_certs').with_ensure('absent')
is_expected.to contain_heat_config('DEFAULT/kombu_ssl_certfile').with_ensure('absent') is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_ssl_certfile').with_ensure('absent')
is_expected.to contain_heat_config('DEFAULT/kombu_ssl_keyfile').with_ensure('absent') is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_ssl_keyfile').with_ensure('absent')
is_expected.to contain_heat_config('DEFAULT/kombu_ssl_version').with_ensure('absent') is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_ssl_version').with_ensure('absent')
end end
it { is_expected.to contain_heat_config('DEFAULT/rabbit_host').with_value( params[:rabbit_host] ) } it { is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_host').with_value( params[:rabbit_host] ) }
it { is_expected.to contain_heat_config('DEFAULT/rabbit_port').with_value( params[:rabbit_port] ) } it { is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_port').with_value( params[:rabbit_port] ) }
it { is_expected.to contain_heat_config('DEFAULT/rabbit_hosts').with_value( "#{params[:rabbit_host]}:#{params[:rabbit_port]}" ) } it { is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_hosts').with_value( "#{params[:rabbit_host]}:#{params[:rabbit_port]}" ) }
it { is_expected.to contain_heat_config('DEFAULT/rabbit_ha_queues').with_value('false') } it { is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_ha_queues').with_value('false') }
it { is_expected.to contain_heat_config('DEFAULT/amqp_durable_queues').with_value(false) } it { is_expected.to contain_heat_config('DEFAULT/amqp_durable_queues').with_value(false) }
end end
shared_examples_for 'rabbit without HA support (without backward compatibility)' do shared_examples_for 'rabbit without HA support (without backward compatibility)' do
it 'configures rabbit' do it 'configures rabbit' do
is_expected.to contain_heat_config('DEFAULT/rabbit_userid').with_value( params[:rabbit_userid] ) is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_userid').with_value( params[:rabbit_userid] )
is_expected.to contain_heat_config('DEFAULT/rabbit_password').with_secret( true ) is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_password').with_secret( true )
is_expected.to contain_heat_config('DEFAULT/rabbit_password').with_value( params[:rabbit_password] ) is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_password').with_value( params[:rabbit_password] )
is_expected.to contain_heat_config('DEFAULT/rabbit_virtual_host').with_value( params[:rabbit_virtual_host] ) is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_virtual_host').with_value( params[:rabbit_virtual_host] )
is_expected.to contain_heat_config('DEFAULT/rabbit_use_ssl').with_value(false) is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_use_ssl').with_value(false)
is_expected.to contain_heat_config('DEFAULT/kombu_ssl_ca_certs').with_ensure('absent') is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_ssl_ca_certs').with_ensure('absent')
is_expected.to contain_heat_config('DEFAULT/kombu_ssl_certfile').with_ensure('absent') is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_ssl_certfile').with_ensure('absent')
is_expected.to contain_heat_config('DEFAULT/kombu_ssl_keyfile').with_ensure('absent') is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_ssl_keyfile').with_ensure('absent')
is_expected.to contain_heat_config('DEFAULT/kombu_ssl_version').with_ensure('absent') is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_ssl_version').with_ensure('absent')
end end
it { is_expected.to contain_heat_config('DEFAULT/rabbit_host').with_ensure('absent') } it { is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_host').with_ensure('absent') }
it { is_expected.to contain_heat_config('DEFAULT/rabbit_port').with_ensure('absent') } it { is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_port').with_ensure('absent') }
it { is_expected.to contain_heat_config('DEFAULT/rabbit_hosts').with_value( params[:rabbit_hosts].join(',') ) } it { is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_hosts').with_value( params[:rabbit_hosts].join(',') ) }
it { is_expected.to contain_heat_config('DEFAULT/rabbit_ha_queues').with_value('false') } it { is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_ha_queues').with_value('false') }
it { is_expected.to contain_heat_config('DEFAULT/amqp_durable_queues').with_value(false) } it { is_expected.to contain_heat_config('DEFAULT/amqp_durable_queues').with_value(false) }
end end
shared_examples_for 'rabbit with HA support' do shared_examples_for 'rabbit with HA support' do
it 'configures rabbit' do it 'configures rabbit' do
is_expected.to contain_heat_config('DEFAULT/rabbit_userid').with_value( params[:rabbit_userid] ) is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_userid').with_value( params[:rabbit_userid] )
is_expected.to contain_heat_config('DEFAULT/rabbit_password').with_value( params[:rabbit_password] ) is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_password').with_value( params[:rabbit_password] )
is_expected.to contain_heat_config('DEFAULT/rabbit_password').with_secret( true ) is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_password').with_secret( true )
is_expected.to contain_heat_config('DEFAULT/rabbit_virtual_host').with_value( params[:rabbit_virtual_host] ) is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_virtual_host').with_value( params[:rabbit_virtual_host] )
is_expected.to contain_heat_config('DEFAULT/rabbit_use_ssl').with_value(false) is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_use_ssl').with_value(false)
is_expected.to contain_heat_config('DEFAULT/kombu_ssl_ca_certs').with_ensure('absent') is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_ssl_ca_certs').with_ensure('absent')
is_expected.to contain_heat_config('DEFAULT/kombu_ssl_certfile').with_ensure('absent') is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_ssl_certfile').with_ensure('absent')
is_expected.to contain_heat_config('DEFAULT/kombu_ssl_keyfile').with_ensure('absent') is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_ssl_keyfile').with_ensure('absent')
is_expected.to contain_heat_config('DEFAULT/kombu_ssl_version').with_ensure('absent') is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_ssl_version').with_ensure('absent')
end end
it { is_expected.to contain_heat_config('DEFAULT/rabbit_host').with_ensure('absent') } it { is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_host').with_ensure('absent') }
it { is_expected.to contain_heat_config('DEFAULT/rabbit_port').with_ensure('absent') } it { is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_port').with_ensure('absent') }
it { is_expected.to contain_heat_config('DEFAULT/rabbit_hosts').with_value( params[:rabbit_hosts].join(',') ) } it { is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_hosts').with_value( params[:rabbit_hosts].join(',') ) }
it { is_expected.to contain_heat_config('DEFAULT/rabbit_ha_queues').with_value('true') } it { is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_ha_queues').with_value('true') }
it { is_expected.to contain_heat_config('DEFAULT/amqp_durable_queues').with_value(true) } it { is_expected.to contain_heat_config('DEFAULT/amqp_durable_queues').with_value(true) }
end end
@ -277,11 +277,11 @@ describe 'heat' do
end end
it do it do
is_expected.to contain_heat_config('DEFAULT/rabbit_use_ssl').with_value('true') is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_use_ssl').with_value('true')
is_expected.to contain_heat_config('DEFAULT/kombu_ssl_ca_certs').with_value('/path/to/ssl/ca/certs') is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_ssl_ca_certs').with_value('/path/to/ssl/ca/certs')
is_expected.to contain_heat_config('DEFAULT/kombu_ssl_certfile').with_value('/path/to/ssl/cert/file') is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_ssl_certfile').with_value('/path/to/ssl/cert/file')
is_expected.to contain_heat_config('DEFAULT/kombu_ssl_keyfile').with_value('/path/to/ssl/keyfile') is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_ssl_keyfile').with_value('/path/to/ssl/keyfile')
is_expected.to contain_heat_config('DEFAULT/kombu_ssl_version').with_value('TLSv1') is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_ssl_version').with_value('TLSv1')
end end
end end
@ -293,11 +293,11 @@ describe 'heat' do
end end
it do it do
is_expected.to contain_heat_config('DEFAULT/rabbit_use_ssl').with_value('true') is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_use_ssl').with_value('true')
is_expected.to contain_heat_config('DEFAULT/kombu_ssl_ca_certs').with_ensure('absent') is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_ssl_ca_certs').with_ensure('absent')
is_expected.to contain_heat_config('DEFAULT/kombu_ssl_certfile').with_ensure('absent') is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_ssl_certfile').with_ensure('absent')
is_expected.to contain_heat_config('DEFAULT/kombu_ssl_keyfile').with_ensure('absent') is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_ssl_keyfile').with_ensure('absent')
is_expected.to contain_heat_config('DEFAULT/kombu_ssl_version').with_value('TLSv1') is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_ssl_version').with_value('TLSv1')
end end
end end
@ -310,11 +310,11 @@ describe 'heat' do
end end
it do it do
is_expected.to contain_heat_config('DEFAULT/rabbit_use_ssl').with_value('false') is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_use_ssl').with_value('false')
is_expected.to contain_heat_config('DEFAULT/kombu_ssl_ca_certs').with_ensure('absent') is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_ssl_ca_certs').with_ensure('absent')
is_expected.to contain_heat_config('DEFAULT/kombu_ssl_certfile').with_ensure('absent') is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_ssl_certfile').with_ensure('absent')
is_expected.to contain_heat_config('DEFAULT/kombu_ssl_keyfile').with_ensure('absent') is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_ssl_keyfile').with_ensure('absent')
is_expected.to contain_heat_config('DEFAULT/kombu_ssl_version').with_ensure('absent') is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_ssl_version').with_ensure('absent')
end end
end end