diff --git a/manifests/api.pp b/manifests/api.pp index 9376a430..0f3f7401 100644 --- a/manifests/api.pp +++ b/manifests/api.pp @@ -363,6 +363,25 @@ class trove::api( kombu_ssl_keyfile => $::trove::kombu_ssl_keyfile, kombu_ssl_version => $::trove::kombu_ssl_version } + } elsif $::trove::rpc_backend == 'amqp' { + oslo::messaging::amqp { 'trove_config': + server_request_prefix => $::trove::amqp_server_request_prefix, + broadcast_prefix => $::trove::amqp_broadcast_prefix, + group_request_prefix => $::trove::amqp_group_request_prefix, + container_name => $::trove::amqp_container_name, + idle_timeout => $::trove::amqp_idle_timeout, + trace => $::trove::amqp_trace, + ssl_ca_file => $::trove::amqp_ssl_ca_file, + ssl_cert_file => $::trove::amqp_ssl_cert_file, + ssl_key_file => $::trove::amqp_ssl_key_file, + ssl_key_password => $::trove::amqp_ssl_key_password, + allow_insecure_clients => $::trove::amqp_allow_insecure_clients, + sasl_mechanisms => $::trove::amqp_sasl_mechanisms, + sasl_config_dir => $::trove::amqp_sasl_config_dir, + sasl_config_name => $::trove::amqp_sasl_config_name, + username => $::trove::amqp_username, + password => $::trove::amqp_password, + } } else { trove_config { 'DEFAULT/rpc_backend' : value => $::trove::rpc_backend; diff --git a/manifests/conductor.pp b/manifests/conductor.pp index c1bb8651..6673def9 100644 --- a/manifests/conductor.pp +++ b/manifests/conductor.pp @@ -136,6 +136,25 @@ class trove::conductor( kombu_ssl_keyfile => $::trove::kombu_ssl_keyfile, kombu_ssl_version => $::trove::kombu_ssl_version } + } elsif $::trove::rpc_backend == 'amqp' { + oslo::messaging::amqp { 'trove_config': + server_request_prefix => $::trove::amqp_server_request_prefix, + broadcast_prefix => $::trove::amqp_broadcast_prefix, + group_request_prefix => $::trove::amqp_group_request_prefix, + container_name => $::trove::amqp_container_name, + idle_timeout => $::trove::amqp_idle_timeout, + trace => $::trove::amqp_trace, + ssl_ca_file => $::trove::amqp_ssl_ca_file, + ssl_cert_file => $::trove::amqp_ssl_cert_file, + ssl_key_file => $::trove::amqp_ssl_key_file, + ssl_key_password => $::trove::amqp_ssl_key_password, + allow_insecure_clients => $::trove::amqp_allow_insecure_clients, + sasl_mechanisms => $::trove::amqp_sasl_mechanisms, + sasl_config_dir => $::trove::amqp_sasl_config_dir, + sasl_config_name => $::trove::amqp_sasl_config_name, + username => $::trove::amqp_username, + password => $::trove::amqp_password, + } } else { trove_conductor_config { 'DEFAULT/rpc_backend' : value => $::trove::rpc_backend diff --git a/manifests/guestagent.pp b/manifests/guestagent.pp index 14844305..eb442514 100644 --- a/manifests/guestagent.pp +++ b/manifests/guestagent.pp @@ -137,6 +137,25 @@ class trove::guestagent( kombu_ssl_keyfile => $::trove::kombu_ssl_keyfile, kombu_ssl_version => $::trove::kombu_ssl_version } + } elsif $::trove::rpc_backend == 'amqp' { + oslo::messaging::amqp { 'trove_config': + server_request_prefix => $::trove::amqp_server_request_prefix, + broadcast_prefix => $::trove::amqp_broadcast_prefix, + group_request_prefix => $::trove::amqp_group_request_prefix, + container_name => $::trove::amqp_container_name, + idle_timeout => $::trove::amqp_idle_timeout, + trace => $::trove::amqp_trace, + ssl_ca_file => $::trove::amqp_ssl_ca_file, + ssl_cert_file => $::trove::amqp_ssl_cert_file, + ssl_key_file => $::trove::amqp_ssl_key_file, + ssl_key_password => $::trove::amqp_ssl_key_password, + allow_insecure_clients => $::trove::amqp_allow_insecure_clients, + sasl_mechanisms => $::trove::amqp_sasl_mechanisms, + sasl_config_dir => $::trove::amqp_sasl_config_dir, + sasl_config_name => $::trove::amqp_sasl_config_name, + username => $::trove::amqp_username, + password => $::trove::amqp_password, + } } else { trove_guestagent_config { 'DEFAULT/rpc_backend' : value => $::trove::rpc_backend diff --git a/manifests/init.pp b/manifests/init.pp index a2461b1f..8f969055 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -101,8 +101,73 @@ # [*rpc_backend*] # (optional) The rpc backend implementation to use, can be: # rabbit (for rabbitmq) +# amqp (for AMQP 1.0) # Defaults to 'rabbit' # +# [*amqp_server_request_prefix*] +# (Optional) Address prefix used when sending to a specific server +# Defaults to $::os_service_default. +# +# [*amqp_broadcast_prefix*] +# (Optional) address prefix used when broadcasting to all servers +# Defaults to $::os_service_default. +# +# [*amqp_group_request_prefix*] +# (Optional) address prefix when sending to any server in group +# Defaults to $::os_service_default. +# +# [*amqp_container_name*] +# (Optional) Name for the AMQP container +# Defaults to $::os_service_default. +# +# [*amqp_idle_timeout*] +# (Optional) Timeout for inactive connections +# Defaults to $::os_service_default. +# +# [*amqp_trace*] +# (Optional) Debug: dump AMQP frames to stdout +# Defaults to $::os_service_default. +# +# [*amqp_ssl_ca_file*] +# (Optional) CA certificate PEM file to verify server certificate +# Defaults to $::os_service_default. +# +# [*amqp_ssl_cert_file*] +# (Optional) Identifying certificate PEM file to present to clients +# Defaults to $::os_service_default. +# +# [*amqp_ssl_key_file*] +# (Optional) Private key PEM file used to sign cert_file certificate +# Defaults to $::os_service_default. +# +# [*amqp_ssl_key_password*] +# (Optional) Password for decrypting ssl_key_file (if encrypted) +# Defaults to $::os_service_default. +# +# [*amqp_allow_insecure_clients*] +# (Optional) Accept clients using either SSL or plain TCP +# Defaults to $::os_service_default. +# +# [*amqp_sasl_mechanisms*] +# (Optional) Space separated list of acceptable SASL mechanisms +# Defaults to $::os_service_default. +# +# [*amqp_sasl_config_dir*] +# (Optional) Path to directory that contains the SASL configuration +# Defaults to $::os_service_default. +# +# [*amqp_sasl_config_name*] +# (Optional) Name of configuration file (without .conf suffix) +# Defaults to $::os_service_default. +# +# [*amqp_username*] +# (Optional) User name for message broker authentication +# Defaults to $::os_service_default. +# +# [*amqp_password*] +# (Optional) Password for message broker authentication +# Defaults to $::os_service_default. +# # [*database_connection*] # (optional) Connection url to connect to trove database. # Defaults to undef. @@ -217,6 +282,22 @@ class trove( $kombu_ssl_version = $::os_service_default, $kombu_reconnect_delay = $::os_service_default, $amqp_durable_queues = $::os_service_default, + $amqp_server_request_prefix = $::os_service_default, + $amqp_broadcast_prefix = $::os_service_default, + $amqp_group_request_prefix = $::os_service_default, + $amqp_container_name = $::os_service_default, + $amqp_idle_timeout = $::os_service_default, + $amqp_trace = $::os_service_default, + $amqp_ssl_ca_file = $::os_service_default, + $amqp_ssl_cert_file = $::os_service_default, + $amqp_ssl_key_file = $::os_service_default, + $amqp_ssl_key_password = $::os_service_default, + $amqp_allow_insecure_clients = $::os_service_default, + $amqp_sasl_mechanisms = $::os_service_default, + $amqp_sasl_config_dir = $::os_service_default, + $amqp_sasl_config_name = $::os_service_default, + $amqp_username = $::os_service_default, + $amqp_password = $::os_service_default, $database_connection = undef, $database_idle_timeout = undef, $database_max_retries = undef, diff --git a/manifests/taskmanager.pp b/manifests/taskmanager.pp index 8157175c..c02b46da 100644 --- a/manifests/taskmanager.pp +++ b/manifests/taskmanager.pp @@ -175,6 +175,25 @@ class trove::taskmanager( kombu_ssl_keyfile => $::trove::kombu_ssl_keyfile, kombu_ssl_version => $::trove::kombu_ssl_version } + } elsif $::trove::rpc_backend == 'amqp' { + oslo::messaging::amqp { 'trove_config': + server_request_prefix => $::trove::amqp_server_request_prefix, + broadcast_prefix => $::trove::amqp_broadcast_prefix, + group_request_prefix => $::trove::amqp_group_request_prefix, + container_name => $::trove::amqp_container_name, + idle_timeout => $::trove::amqp_idle_timeout, + trace => $::trove::amqp_trace, + ssl_ca_file => $::trove::amqp_ssl_ca_file, + ssl_cert_file => $::trove::amqp_ssl_cert_file, + ssl_key_file => $::trove::amqp_ssl_key_file, + ssl_key_password => $::trove::amqp_ssl_key_password, + allow_insecure_clients => $::trove::amqp_allow_insecure_clients, + sasl_mechanisms => $::trove::amqp_sasl_mechanisms, + sasl_config_dir => $::trove::amqp_sasl_config_dir, + sasl_config_name => $::trove::amqp_sasl_config_name, + username => $::trove::amqp_username, + password => $::trove::amqp_password, + } } else { trove_taskmanager_config { 'DEFAULT/rpc_backend' : value => $::trove::rpc_backend diff --git a/releasenotes/notes/add_oslo_messaging_amqp-ee62f22b973da190.yaml b/releasenotes/notes/add_oslo_messaging_amqp-ee62f22b973da190.yaml new file mode 100644 index 00000000..3e1907e7 --- /dev/null +++ b/releasenotes/notes/add_oslo_messaging_amqp-ee62f22b973da190.yaml @@ -0,0 +1,4 @@ +--- +features: + - Add support for oslo_messaging_amqp backend via puppet-oslo resource + \ No newline at end of file diff --git a/spec/classes/trove_api_spec.rb b/spec/classes/trove_api_spec.rb index 6d026c42..b5a602fd 100644 --- a/spec/classes/trove_api_spec.rb +++ b/spec/classes/trove_api_spec.rb @@ -248,6 +248,33 @@ describe 'trove::api' do end end + context 'with amqp rpc' do + let :pre_condition do + "class { 'trove' : + nova_proxy_admin_pass => 'verysecrete', + rpc_backend => 'amqp' }" + end + + it do + is_expected.to contain_trove_config('DEFAULT/rpc_backend').with_value('amqp') + is_expected.to contain_trove_config('oslo_messaging_amqp/server_request_prefix').with_value('') + is_expected.to contain_trove_config('oslo_messaging_amqp/broadcast_prefix').with_value('') + is_expected.to contain_trove_config('oslo_messaging_amqp/group_request_prefix').with_value('') + is_expected.to contain_trove_config('oslo_messaging_amqp/container_name').with_value('') + is_expected.to contain_trove_config('oslo_messaging_amqp/idle_timeout').with_value('') + is_expected.to contain_trove_config('oslo_messaging_amqp/trace').with_value('') + is_expected.to contain_trove_config('oslo_messaging_amqp/ssl_ca_file').with_value('') + is_expected.to contain_trove_config('oslo_messaging_amqp/ssl_cert_file').with_value('') + is_expected.to contain_trove_config('oslo_messaging_amqp/ssl_key_file').with_value('') + is_expected.to contain_trove_config('oslo_messaging_amqp/ssl_key_password').with_value('') + is_expected.to contain_trove_config('oslo_messaging_amqp/allow_insecure_clients').with_value('') + is_expected.to contain_trove_config('oslo_messaging_amqp/sasl_mechanisms').with_value('') + is_expected.to contain_trove_config('oslo_messaging_amqp/sasl_config_dir').with_value('') + is_expected.to contain_trove_config('oslo_messaging_amqp/sasl_config_name').with_value('') + is_expected.to contain_trove_config('oslo_messaging_amqp/username').with_value('') + is_expected.to contain_trove_config('oslo_messaging_amqp/password').with_value('') + end + end end context 'on Debian platforms' do diff --git a/spec/classes/trove_conductor_spec.rb b/spec/classes/trove_conductor_spec.rb index 71bda2d3..022dcb7e 100644 --- a/spec/classes/trove_conductor_spec.rb +++ b/spec/classes/trove_conductor_spec.rb @@ -149,6 +149,34 @@ describe 'trove::conductor' do end end + context 'with amqp rpc' do + let :pre_condition do + "class { 'trove' : + nova_proxy_admin_pass => 'verysecrete', + rpc_backend => 'amqp' }" + end + + it do + is_expected.to contain_trove_config('DEFAULT/rpc_backend').with_value('amqp') + is_expected.to contain_trove_config('oslo_messaging_amqp/server_request_prefix').with_value('') + is_expected.to contain_trove_config('oslo_messaging_amqp/broadcast_prefix').with_value('') + is_expected.to contain_trove_config('oslo_messaging_amqp/group_request_prefix').with_value('') + is_expected.to contain_trove_config('oslo_messaging_amqp/container_name').with_value('') + is_expected.to contain_trove_config('oslo_messaging_amqp/idle_timeout').with_value('') + is_expected.to contain_trove_config('oslo_messaging_amqp/trace').with_value('') + is_expected.to contain_trove_config('oslo_messaging_amqp/ssl_ca_file').with_value('') + is_expected.to contain_trove_config('oslo_messaging_amqp/ssl_cert_file').with_value('') + is_expected.to contain_trove_config('oslo_messaging_amqp/ssl_key_file').with_value('') + is_expected.to contain_trove_config('oslo_messaging_amqp/ssl_key_password').with_value('') + is_expected.to contain_trove_config('oslo_messaging_amqp/allow_insecure_clients').with_value('') + is_expected.to contain_trove_config('oslo_messaging_amqp/sasl_mechanisms').with_value('') + is_expected.to contain_trove_config('oslo_messaging_amqp/sasl_config_dir').with_value('') + is_expected.to contain_trove_config('oslo_messaging_amqp/sasl_config_name').with_value('') + is_expected.to contain_trove_config('oslo_messaging_amqp/username').with_value('') + is_expected.to contain_trove_config('oslo_messaging_amqp/password').with_value('') + end + end + end context 'on Debian platforms' do diff --git a/spec/classes/trove_guestagent_spec.rb b/spec/classes/trove_guestagent_spec.rb index 2c18e896..d27f452e 100644 --- a/spec/classes/trove_guestagent_spec.rb +++ b/spec/classes/trove_guestagent_spec.rb @@ -162,6 +162,34 @@ describe 'trove::guestagent' do end end + context 'with amqp rpc' do + let :pre_condition do + "class { 'trove' : + nova_proxy_admin_pass => 'verysecrete', + rpc_backend => 'amqp' }" + end + + it do + is_expected.to contain_trove_config('DEFAULT/rpc_backend').with_value('amqp') + is_expected.to contain_trove_config('oslo_messaging_amqp/server_request_prefix').with_value('') + is_expected.to contain_trove_config('oslo_messaging_amqp/broadcast_prefix').with_value('') + is_expected.to contain_trove_config('oslo_messaging_amqp/group_request_prefix').with_value('') + is_expected.to contain_trove_config('oslo_messaging_amqp/container_name').with_value('') + is_expected.to contain_trove_config('oslo_messaging_amqp/idle_timeout').with_value('') + is_expected.to contain_trove_config('oslo_messaging_amqp/trace').with_value('') + is_expected.to contain_trove_config('oslo_messaging_amqp/ssl_ca_file').with_value('') + is_expected.to contain_trove_config('oslo_messaging_amqp/ssl_cert_file').with_value('') + is_expected.to contain_trove_config('oslo_messaging_amqp/ssl_key_file').with_value('') + is_expected.to contain_trove_config('oslo_messaging_amqp/ssl_key_password').with_value('') + is_expected.to contain_trove_config('oslo_messaging_amqp/allow_insecure_clients').with_value('') + is_expected.to contain_trove_config('oslo_messaging_amqp/sasl_mechanisms').with_value('') + is_expected.to contain_trove_config('oslo_messaging_amqp/sasl_config_dir').with_value('') + is_expected.to contain_trove_config('oslo_messaging_amqp/sasl_config_name').with_value('') + is_expected.to contain_trove_config('oslo_messaging_amqp/username').with_value('') + is_expected.to contain_trove_config('oslo_messaging_amqp/password').with_value('') + end + end + end context 'on Debian platforms' do diff --git a/spec/classes/trove_taskmanager_spec.rb b/spec/classes/trove_taskmanager_spec.rb index 4f79b059..e9de195f 100644 --- a/spec/classes/trove_taskmanager_spec.rb +++ b/spec/classes/trove_taskmanager_spec.rb @@ -258,6 +258,33 @@ describe 'trove::taskmanager' do end end + context 'with amqp rpc' do + let :pre_condition do + "class { 'trove' : + nova_proxy_admin_pass => 'verysecrete', + rpc_backend => 'amqp' }" + end + + it do + is_expected.to contain_trove_config('DEFAULT/rpc_backend').with_value('amqp') + is_expected.to contain_trove_config('oslo_messaging_amqp/server_request_prefix').with_value('') + is_expected.to contain_trove_config('oslo_messaging_amqp/broadcast_prefix').with_value('') + is_expected.to contain_trove_config('oslo_messaging_amqp/group_request_prefix').with_value('') + is_expected.to contain_trove_config('oslo_messaging_amqp/container_name').with_value('') + is_expected.to contain_trove_config('oslo_messaging_amqp/idle_timeout').with_value('') + is_expected.to contain_trove_config('oslo_messaging_amqp/trace').with_value('') + is_expected.to contain_trove_config('oslo_messaging_amqp/ssl_ca_file').with_value('') + is_expected.to contain_trove_config('oslo_messaging_amqp/ssl_cert_file').with_value('') + is_expected.to contain_trove_config('oslo_messaging_amqp/ssl_key_file').with_value('') + is_expected.to contain_trove_config('oslo_messaging_amqp/ssl_key_password').with_value('') + is_expected.to contain_trove_config('oslo_messaging_amqp/allow_insecure_clients').with_value('') + is_expected.to contain_trove_config('oslo_messaging_amqp/sasl_mechanisms').with_value('') + is_expected.to contain_trove_config('oslo_messaging_amqp/sasl_config_dir').with_value('') + is_expected.to contain_trove_config('oslo_messaging_amqp/sasl_config_name').with_value('') + is_expected.to contain_trove_config('oslo_messaging_amqp/username').with_value('') + is_expected.to contain_trove_config('oslo_messaging_amqp/password').with_value('') + end + end end context 'on Debian platforms' do