diff --git a/README.md b/README.md index 972fcd06..3aeeedbc 100644 --- a/README.md +++ b/README.md @@ -55,12 +55,10 @@ documentation to assist you in understanding the available deployment options. ```puppet # enable heat resources class { '::heat': - rabbit_userid => 'heat', - rabbit_password => 'an_even_bigger_secret', - rabbit_host => '127.0.0.1', - database_connection => 'mysql+pymysql://heat:a_big_secret@127.0.0.1/heat?charset=utf8', - identity_uri => 'http://127.0.0.1:5000/', - keystone_password => 'a_big_secret', + default_transport_url => 'rabbit://heat:an_even_bigger_secret@127.0.0.1:5672/heat', + database_connection => 'mysql+pymysql://heat:a_big_secret@127.0.0.1/heat?charset=utf8', + identity_uri => 'http://127.0.0.1:5000/', + keystone_password => 'a_big_secret', } class { '::heat::api': } diff --git a/spec/classes/heat_init_spec.rb b/spec/classes/heat_init_spec.rb index e500d7f8..b00a920d 100644 --- a/spec/classes/heat_init_spec.rb +++ b/spec/classes/heat_init_spec.rb @@ -25,24 +25,13 @@ describe 'heat' do shared_examples_for 'heat' do - context 'with rabbit_host parameter' do + context 'with a normal setup' do it_configures 'a heat base installation' - it_configures 'rabbit without HA support (with backward compatibility)' + it_configures 'configures default rabbitmq parameters' end - context 'with rabbit_hosts parameter' do - context 'with one server' do - it_configures 'a heat base installation' - it_configures 'rabbit without HA support (without backward compatibility)' - end - - context 'with multiple servers' do - before { params.merge!( - :rabbit_ha_queues => true, - :amqp_durable_queues => true) } - it_configures 'a heat base installation' - it_configures 'rabbit with HA support' - end + context 'with HA support' do + it_configures 'configures rabbit with HA and durable' end context 'with rabbit heartbeat configured' do @@ -171,7 +160,7 @@ describe 'heat' do end - shared_examples_for 'rabbit without HA support (with backward compatibility)' do + shared_examples_for 'configures default rabbitmq parameters' do it 'configures rabbit' do is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_reconnect_delay').with_value('') is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_failover_strategy').with_value('') @@ -191,54 +180,16 @@ describe 'heat' do it { is_expected.to contain_heat_config('oslo_messaging_rabbit/amqp_durable_queues').with_value('') } end - shared_examples_for 'rabbit without HA support (without backward compatibility)' do - it 'configures rabbit' do - is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_reconnect_delay').with_value('') - is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_failover_strategy').with_value('') - is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_compression').with_value('') - is_expected.to contain_heat_config('oslo_messaging_rabbit/heartbeat_timeout_threshold').with_value('') - is_expected.to contain_heat_config('oslo_messaging_rabbit/heartbeat_rate').with_value('') - is_expected.to contain_oslo__messaging__rabbit('heat_config').with( - :rabbit_use_ssl => '', - :kombu_ssl_ca_certs => '', - :kombu_ssl_certfile => '', - :kombu_ssl_keyfile => '', - :kombu_ssl_version => '', - ) + shared_examples_for 'configures rabbit with HA and durable' do + before do + params.merge!( :rabbit_ha_queues => true, + :amqp_durable_queues => true ) end - it { is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_ha_queues').with_value('') } - it { is_expected.to contain_heat_config('oslo_messaging_rabbit/amqp_durable_queues').with_value('') } - end - shared_examples_for 'rabbit with HA support' do - it 'configures rabbit' do - is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_reconnect_delay').with_value('') - is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_failover_strategy').with_value('') - is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_compression').with_value('') - is_expected.to contain_heat_config('oslo_messaging_rabbit/heartbeat_timeout_threshold').with_value('') - is_expected.to contain_heat_config('oslo_messaging_rabbit/heartbeat_rate').with_value('') - is_expected.to contain_oslo__messaging__rabbit('heat_config').with( - :rabbit_use_ssl => '', - :kombu_ssl_ca_certs => '', - :kombu_ssl_certfile => '', - :kombu_ssl_keyfile => '', - :kombu_ssl_version => '', - ) - end - it { is_expected.to contain_heat_config('oslo_messaging_rabbit/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('oslo_messaging_rabbit/amqp_durable_queues').with_value(true) } end - shared_examples_for 'single rabbit_host with ha queues' do - let :params do - req_params.merge({'rabbit_ha_queues' => true}) - end - - it 'should contain rabbit_ha_queues' do - is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_ha_queues').with_value('true') - end - end - shared_examples_for 'rabbit with heartbeat configured' do it 'configures rabbit' do is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_reconnect_delay').with_value('')