Skip to content

Commit

Permalink
Move rabbit/kombu settings to oslo_messaging_rabbit section
Browse files Browse the repository at this point in the history
Kilo oslo-messaging deprecates rabbit/kombu settings in the
DEFAULT section.

Move these settings to proper oslo_messaging_rabbit section.

Change-Id: I0b822c37b81e9bcbb7f51959300167ff7ff3eb68
Closes-bug: 1444161
Signed-off-by: Gael Chamoulaud <[email protected]>
  • Loading branch information
strider committed Jun 8, 2015
1 parent 264ea1b commit 208cee7
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 63 deletions.
48 changes: 24 additions & 24 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -167,64 +167,64 @@
if $rpc_backend == 'ceilometer.openstack.common.rpc.impl_kombu' {

if $rabbit_hosts {
ceilometer_config { 'DEFAULT/rabbit_host': ensure => absent }
ceilometer_config { 'DEFAULT/rabbit_port': ensure => absent }
ceilometer_config { 'DEFAULT/rabbit_hosts':
ceilometer_config { 'oslo_messaging_rabbit/rabbit_host': ensure => absent }
ceilometer_config { 'oslo_messaging_rabbit/rabbit_port': ensure => absent }
ceilometer_config { 'oslo_messaging_rabbit/rabbit_hosts':
value => join($rabbit_hosts, ',')
}
} else {
ceilometer_config { 'DEFAULT/rabbit_host': value => $rabbit_host }
ceilometer_config { 'DEFAULT/rabbit_port': value => $rabbit_port }
ceilometer_config { 'DEFAULT/rabbit_hosts':
ceilometer_config { 'oslo_messaging_rabbit/rabbit_host': value => $rabbit_host }
ceilometer_config { 'oslo_messaging_rabbit/rabbit_port': value => $rabbit_port }
ceilometer_config { 'oslo_messaging_rabbit/rabbit_hosts':
value => "${rabbit_host}:${rabbit_port}"
}
}

if size($rabbit_hosts) > 1 {
ceilometer_config { 'DEFAULT/rabbit_ha_queues': value => true }
ceilometer_config { 'oslo_messaging_rabbit/rabbit_ha_queues': value => true }
} else {
ceilometer_config { 'DEFAULT/rabbit_ha_queues': value => false }
ceilometer_config { 'oslo_messaging_rabbit/rabbit_ha_queues': value => false }
}

ceilometer_config {
'DEFAULT/rabbit_userid' : value => $rabbit_userid;
'DEFAULT/rabbit_password' : value => $rabbit_password, secret => true;
'DEFAULT/rabbit_virtual_host' : value => $rabbit_virtual_host;
'DEFAULT/rabbit_use_ssl' : value => $rabbit_use_ssl;
'oslo_messaging_rabbit/rabbit_userid' : value => $rabbit_userid;
'oslo_messaging_rabbit/rabbit_password' : value => $rabbit_password, secret => true;
'oslo_messaging_rabbit/rabbit_virtual_host' : value => $rabbit_virtual_host;
'oslo_messaging_rabbit/rabbit_use_ssl' : value => $rabbit_use_ssl;
}

if $rabbit_use_ssl {

if $kombu_ssl_ca_certs {
ceilometer_config { 'DEFAULT/kombu_ssl_ca_certs': value => $kombu_ssl_ca_certs; }
ceilometer_config { 'oslo_messaging_rabbit/kombu_ssl_ca_certs': value => $kombu_ssl_ca_certs; }
} else {
ceilometer_config { 'DEFAULT/kombu_ssl_ca_certs': ensure => absent; }
ceilometer_config { 'oslo_messaging_rabbit/kombu_ssl_ca_certs': ensure => absent; }
}

if $kombu_ssl_certfile or $kombu_ssl_keyfile {
ceilometer_config {
'DEFAULT/kombu_ssl_certfile': value => $kombu_ssl_certfile;
'DEFAULT/kombu_ssl_keyfile': value => $kombu_ssl_keyfile;
'oslo_messaging_rabbit/kombu_ssl_certfile': value => $kombu_ssl_certfile;
'oslo_messaging_rabbit/kombu_ssl_keyfile': value => $kombu_ssl_keyfile;
}
} else {
ceilometer_config {
'DEFAULT/kombu_ssl_certfile': ensure => absent;
'DEFAULT/kombu_ssl_keyfile': ensure => absent;
'oslo_messaging_rabbit/kombu_ssl_certfile': ensure => absent;
'oslo_messaging_rabbit/kombu_ssl_keyfile': ensure => absent;
}
}

if $kombu_ssl_version {
ceilometer_config { 'DEFAULT/kombu_ssl_version': value => $kombu_ssl_version; }
ceilometer_config { 'oslo_messaging_rabbit/kombu_ssl_version': value => $kombu_ssl_version; }
} else {
ceilometer_config { 'DEFAULT/kombu_ssl_version': ensure => absent; }
ceilometer_config { 'oslo_messaging_rabbit/kombu_ssl_version': ensure => absent; }
}

} else {
ceilometer_config {
'DEFAULT/kombu_ssl_ca_certs': ensure => absent;
'DEFAULT/kombu_ssl_certfile': ensure => absent;
'DEFAULT/kombu_ssl_keyfile': ensure => absent;
'DEFAULT/kombu_ssl_version': ensure => absent;
'oslo_messaging_rabbit/kombu_ssl_ca_certs': ensure => absent;
'oslo_messaging_rabbit/kombu_ssl_certfile': ensure => absent;
'oslo_messaging_rabbit/kombu_ssl_keyfile': ensure => absent;
'oslo_messaging_rabbit/kombu_ssl_version': ensure => absent;
}
}

Expand Down
78 changes: 39 additions & 39 deletions spec/classes/ceilometer_init_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -174,58 +174,58 @@
shared_examples_for 'rabbit without HA support (with backward compatibility)' do

it 'configures rabbit' do
is_expected.to contain_ceilometer_config('DEFAULT/rabbit_userid').with_value( params[:rabbit_userid] )
is_expected.to contain_ceilometer_config('DEFAULT/rabbit_password').with_value( params[:rabbit_password] )
is_expected.to contain_ceilometer_config('DEFAULT/rabbit_password').with_value( params[:rabbit_password] ).with_secret(true)
is_expected.to contain_ceilometer_config('DEFAULT/rabbit_virtual_host').with_value( params[:rabbit_virtual_host] )
is_expected.to contain_ceilometer_config('oslo_messaging_rabbit/rabbit_userid').with_value( params[:rabbit_userid] )
is_expected.to contain_ceilometer_config('oslo_messaging_rabbit/rabbit_password').with_value( params[:rabbit_password] )
is_expected.to contain_ceilometer_config('oslo_messaging_rabbit/rabbit_password').with_value( params[:rabbit_password] ).with_secret(true)
is_expected.to contain_ceilometer_config('oslo_messaging_rabbit/rabbit_virtual_host').with_value( params[:rabbit_virtual_host] )
end

it { is_expected.to contain_ceilometer_config('DEFAULT/rabbit_host').with_value( params[:rabbit_host] ) }
it { is_expected.to contain_ceilometer_config('DEFAULT/rabbit_port').with_value( params[:rabbit_port] ) }
it { is_expected.to contain_ceilometer_config('DEFAULT/rabbit_hosts').with_value( "#{params[:rabbit_host]}:#{params[:rabbit_port]}" ) }
it { is_expected.to contain_ceilometer_config('DEFAULT/rabbit_ha_queues').with_value('false') }
it { is_expected.to contain_ceilometer_config('oslo_messaging_rabbit/rabbit_host').with_value( params[:rabbit_host] ) }
it { is_expected.to contain_ceilometer_config('oslo_messaging_rabbit/rabbit_port').with_value( params[:rabbit_port] ) }
it { is_expected.to contain_ceilometer_config('oslo_messaging_rabbit/rabbit_hosts').with_value( "#{params[:rabbit_host]}:#{params[:rabbit_port]}" ) }
it { is_expected.to contain_ceilometer_config('oslo_messaging_rabbit/rabbit_ha_queues').with_value('false') }

end

shared_examples_for 'rabbit without HA support (without backward compatibility)' do

it 'configures rabbit' do
is_expected.to contain_ceilometer_config('DEFAULT/rabbit_userid').with_value( params[:rabbit_userid] )
is_expected.to contain_ceilometer_config('DEFAULT/rabbit_password').with_value( params[:rabbit_password] )
is_expected.to contain_ceilometer_config('DEFAULT/rabbit_password').with_value( params[:rabbit_password] ).with_secret(true)
is_expected.to contain_ceilometer_config('DEFAULT/rabbit_virtual_host').with_value( params[:rabbit_virtual_host] )
is_expected.to contain_ceilometer_config('oslo_messaging_rabbit/rabbit_userid').with_value( params[:rabbit_userid] )
is_expected.to contain_ceilometer_config('oslo_messaging_rabbit/rabbit_password').with_value( params[:rabbit_password] )
is_expected.to contain_ceilometer_config('oslo_messaging_rabbit/rabbit_password').with_value( params[:rabbit_password] ).with_secret(true)
is_expected.to contain_ceilometer_config('oslo_messaging_rabbit/rabbit_virtual_host').with_value( params[:rabbit_virtual_host] )
end

it { is_expected.to contain_ceilometer_config('DEFAULT/rabbit_host').with_ensure('absent') }
it { is_expected.to contain_ceilometer_config('DEFAULT/rabbit_port').with_ensure('absent') }
it { is_expected.to contain_ceilometer_config('DEFAULT/rabbit_hosts').with_value( params[:rabbit_hosts].join(',') ) }
it { is_expected.to contain_ceilometer_config('DEFAULT/rabbit_ha_queues').with_value('false') }
it { is_expected.to contain_ceilometer_config('oslo_messaging_rabbit/rabbit_host').with_ensure('absent') }
it { is_expected.to contain_ceilometer_config('oslo_messaging_rabbit/rabbit_port').with_ensure('absent') }
it { is_expected.to contain_ceilometer_config('oslo_messaging_rabbit/rabbit_hosts').with_value( params[:rabbit_hosts].join(',') ) }
it { is_expected.to contain_ceilometer_config('oslo_messaging_rabbit/rabbit_ha_queues').with_value('false') }

end

shared_examples_for 'rabbit with HA support' do

it 'configures rabbit' do
is_expected.to contain_ceilometer_config('DEFAULT/rabbit_userid').with_value( params[:rabbit_userid] )
is_expected.to contain_ceilometer_config('DEFAULT/rabbit_password').with_value( params[:rabbit_password] )
is_expected.to contain_ceilometer_config('DEFAULT/rabbit_password').with_value( params[:rabbit_password] ).with_secret(true)
is_expected.to contain_ceilometer_config('DEFAULT/rabbit_virtual_host').with_value( params[:rabbit_virtual_host] )
is_expected.to contain_ceilometer_config('oslo_messaging_rabbit/rabbit_userid').with_value( params[:rabbit_userid] )
is_expected.to contain_ceilometer_config('oslo_messaging_rabbit/rabbit_password').with_value( params[:rabbit_password] )
is_expected.to contain_ceilometer_config('oslo_messaging_rabbit/rabbit_password').with_value( params[:rabbit_password] ).with_secret(true)
is_expected.to contain_ceilometer_config('oslo_messaging_rabbit/rabbit_virtual_host').with_value( params[:rabbit_virtual_host] )
end

it { is_expected.to contain_ceilometer_config('DEFAULT/rabbit_host').with_ensure('absent') }
it { is_expected.to contain_ceilometer_config('DEFAULT/rabbit_port').with_ensure('absent') }
it { is_expected.to contain_ceilometer_config('DEFAULT/rabbit_hosts').with_value( params[:rabbit_hosts].join(',') ) }
it { is_expected.to contain_ceilometer_config('DEFAULT/rabbit_ha_queues').with_value('true') }
it { is_expected.to contain_ceilometer_config('oslo_messaging_rabbit/rabbit_host').with_ensure('absent') }
it { is_expected.to contain_ceilometer_config('oslo_messaging_rabbit/rabbit_port').with_ensure('absent') }
it { is_expected.to contain_ceilometer_config('oslo_messaging_rabbit/rabbit_hosts').with_value( params[:rabbit_hosts].join(',') ) }
it { is_expected.to contain_ceilometer_config('oslo_messaging_rabbit/rabbit_ha_queues').with_value('true') }

end

shared_examples_for 'rabbit with SSL support' do
context "with default parameters" do
it { is_expected.to contain_ceilometer_config('DEFAULT/rabbit_use_ssl').with_value('false') }
it { is_expected.to contain_ceilometer_config('DEFAULT/kombu_ssl_ca_certs').with_ensure('absent') }
it { is_expected.to contain_ceilometer_config('DEFAULT/kombu_ssl_certfile').with_ensure('absent') }
it { is_expected.to contain_ceilometer_config('DEFAULT/kombu_ssl_keyfile').with_ensure('absent') }
it { is_expected.to contain_ceilometer_config('DEFAULT/kombu_ssl_version').with_ensure('absent') }
it { is_expected.to contain_ceilometer_config('oslo_messaging_rabbit/rabbit_use_ssl').with_value('false') }
it { is_expected.to contain_ceilometer_config('oslo_messaging_rabbit/kombu_ssl_ca_certs').with_ensure('absent') }
it { is_expected.to contain_ceilometer_config('oslo_messaging_rabbit/kombu_ssl_certfile').with_ensure('absent') }
it { is_expected.to contain_ceilometer_config('oslo_messaging_rabbit/kombu_ssl_keyfile').with_ensure('absent') }
it { is_expected.to contain_ceilometer_config('oslo_messaging_rabbit/kombu_ssl_version').with_ensure('absent') }
end

context "with SSL enabled with kombu" do
Expand All @@ -237,23 +237,23 @@
:kombu_ssl_version => 'TLSv1'
) }

it { is_expected.to contain_ceilometer_config('DEFAULT/rabbit_use_ssl').with_value('true') }
it { is_expected.to contain_ceilometer_config('DEFAULT/kombu_ssl_ca_certs').with_value('/path/to/ca.crt') }
it { is_expected.to contain_ceilometer_config('DEFAULT/kombu_ssl_certfile').with_value('/path/to/cert.crt') }
it { is_expected.to contain_ceilometer_config('DEFAULT/kombu_ssl_keyfile').with_value('/path/to/cert.key') }
it { is_expected.to contain_ceilometer_config('DEFAULT/kombu_ssl_version').with_value('TLSv1') }
it { is_expected.to contain_ceilometer_config('oslo_messaging_rabbit/rabbit_use_ssl').with_value('true') }
it { is_expected.to contain_ceilometer_config('oslo_messaging_rabbit/kombu_ssl_ca_certs').with_value('/path/to/ca.crt') }
it { is_expected.to contain_ceilometer_config('oslo_messaging_rabbit/kombu_ssl_certfile').with_value('/path/to/cert.crt') }
it { is_expected.to contain_ceilometer_config('oslo_messaging_rabbit/kombu_ssl_keyfile').with_value('/path/to/cert.key') }
it { is_expected.to contain_ceilometer_config('oslo_messaging_rabbit/kombu_ssl_version').with_value('TLSv1') }
end

context "with SSL enabled without kombu" do
before { params.merge!(
:rabbit_use_ssl => 'true'
) }

it { is_expected.to contain_ceilometer_config('DEFAULT/rabbit_use_ssl').with_value('true') }
it { is_expected.to contain_ceilometer_config('DEFAULT/kombu_ssl_ca_certs').with_ensure('absent') }
it { is_expected.to contain_ceilometer_config('DEFAULT/kombu_ssl_certfile').with_ensure('absent') }
it { is_expected.to contain_ceilometer_config('DEFAULT/kombu_ssl_keyfile').with_ensure('absent') }
it { is_expected.to contain_ceilometer_config('DEFAULT/kombu_ssl_version').with_value('TLSv1') }
it { is_expected.to contain_ceilometer_config('oslo_messaging_rabbit/rabbit_use_ssl').with_value('true') }
it { is_expected.to contain_ceilometer_config('oslo_messaging_rabbit/kombu_ssl_ca_certs').with_ensure('absent') }
it { is_expected.to contain_ceilometer_config('oslo_messaging_rabbit/kombu_ssl_certfile').with_ensure('absent') }
it { is_expected.to contain_ceilometer_config('oslo_messaging_rabbit/kombu_ssl_keyfile').with_ensure('absent') }
it { is_expected.to contain_ceilometer_config('oslo_messaging_rabbit/kombu_ssl_version').with_value('TLSv1') }
end

context "with SSL wrongly configured" do
Expand Down

0 comments on commit 208cee7

Please sign in to comment.