Fix rabbitmq README and examples

Change-Id: Ic8d6fd0c75384ef272fe54af009a329df67e9d45
This commit is contained in:
Tobias Urdin 2018-10-21 16:53:51 +02:00
parent c0c8164c92
commit 4e11e3fe4e
3 changed files with 22 additions and 30 deletions

View File

@ -46,10 +46,8 @@ To utilize the ironic module's functionality you will need to declare multiple r
```puppet
# enable Ironic resources
class { '::ironic':
rabbit_userid => 'ironic',
rabbit_password => 'an_even_bigger_secret',
rabbit_host => '127.0.0.1',
database_connection => 'mysql://ironic:a_big_secret@127.0.0.1/ironic?charset=utf8',
default_transport_url => 'rabbit://ironic:an_even_bigger_secret@127.0.0.1:5672/ironic',
database_connection => 'mysql://ironic:a_big_secret@127.0.0.1/ironic?charset=utf8',
}
class { '::ironic::db::mysql':

View File

@ -81,17 +81,19 @@ node 'db' {
node 'controller' {
class { '::ironic':
db_password => $db_password,
db_name => $db_name,
db_user => $db_username,
db_host => $db_host,
rabbit_password => $rabbit_password,
rabbit_userid => $rabbit_user,
rabbit_virtual_host => $rabbit_vhost,
rabbit_hosts => $rabbit_hosts,
glance_api_servers => $glance_api_servers,
db_password => $db_password,
db_name => $db_name,
db_user => $db_username,
db_host => $db_host,
default_transport_url => os_transport_url({
'transport' => 'rabbit',
'hosts' => $rabbit_hosts,
'port' => $rabbit_port,
'username' => $rabbit_user,
'password' => $rabbit_password,
'virtual_host' => $rabbit_vhost,
}),
glance_api_servers => $glance_api_servers,
}
class { '::ironic::api': }

View File

@ -36,27 +36,19 @@ describe 'ironic' do
shared_examples_for 'ironic' do
context 'and if rabbit_host parameter is provided' do
context 'ironic setup' do
it_configures 'a ironic base installation'
it_configures 'with SSL disabled'
it_configures 'with SSL enabled without kombu'
it_configures 'with SSL enabled with kombu'
it_configures 'with amqp_durable_queues disabled'
it_configures 'with amqp_durable_queues enabled'
it_configures 'without rabbit HA'
end
context 'and if rabbit_hosts parameter is provided' do
context 'with one server' do
it_configures 'a ironic base installation'
it_configures 'rabbit HA with a single virtual host'
end
context 'with multiple servers' do
before { params.merge!( :rabbit_ha_queues => true ) }
it_configures 'a ironic base installation'
it_configures 'rabbit HA with multiple hosts'
end
context 'ironic setup with rabbit HA' do
before { params.merge!( :rabbit_ha_queues => true ) }
it_configures 'with rabbit HA'
end
context 'with amqp messaging' do
@ -121,13 +113,13 @@ describe 'ironic' do
end
end
shared_examples_for 'rabbit HA with a single virtual host' do
shared_examples_for 'without rabbit HA' do
it 'in ironic.conf' do
is_expected.to contain_ironic_config('oslo_messaging_rabbit/rabbit_ha_queues').with_value('<SERVICE DEFAULT>')
end
end
shared_examples_for 'rabbit HA with multiple hosts' do
shared_examples_for 'with rabbit HA' do
it 'in ironic.conf' do
is_expected.to contain_ironic_config('oslo_messaging_rabbit/rabbit_ha_queues').with_value(true)
end