From 1f4a1e71a19743c6fc8f71aaa8aaf6103c5cc99d Mon Sep 17 00:00:00 2001 From: Andrew Smith Date: Wed, 16 May 2018 20:21:56 -0400 Subject: [PATCH] Update to use oslo.messaging services for RPC and Notify This introduces oslo.messaging variables that define the RPC and Notify transports for the OpenStack services. These parameters replace the rabbitmq values and are used to generate the messaging transport_url for the service. The association of the messaging backend server to the oslo.messaging services will then be transparent to the aodh service. This patch: * Add oslo.messaging variables for RPC and Notify to defaults * Update transport_url generation (add for notifications) * Add oslo.messaging to tests inventory * Update tests * Add release note * Update README and example Depends-On: If4326a6848d2d32af284fdbb94798eb0b03734d5 Depends-On: I2b09145b60116c029fc85477399c24f94974b61d Change-Id: I356e7256f5e8090f35dce8a02fd633638fd659fa --- README.rst | 16 ++++++++---- defaults/main.yml | 25 +++++++++++++------ doc/source/index.rst | 16 ++++++++---- examples/playbook.yml | 16 ++++++++---- ...ng-separate-backends-60f81dae397b1c96.yaml | 15 +++++++++++ templates/aodh.conf.j2 | 7 ++++-- tests/inventory | 6 +++++ tests/os_aodh-overrides.yml | 10 +++++--- tests/test-install-aodh.yml | 11 +++++--- 9 files changed, 90 insertions(+), 32 deletions(-) create mode 100644 releasenotes/notes/oslo-messaging-separate-backends-60f81dae397b1c96.yaml diff --git a/README.rst b/README.rst index 9b1a98b..7c6baba 100644 --- a/README.rst +++ b/README.rst @@ -43,11 +43,17 @@ To use this role, define the following variables: # Needed for aodh to talk to memcached memcached_servers: 127.0.0.1 memcached_encryption_key: "some_key" - # Needed for aodh to locate and connect to the RabbitMQ cluster - aodh_rabbitmq_password: "secrete" - rabbitmq_servers: "10.100.100.2" - rabbitmq_use_ssl: true - rabbitmq_port: 5671 + # Needed for aodh to locate and connect to Oslo.Messaging + aodh_oslomsg_rpc_transport: rabbit + aodh_oslomsg_rpc_password: "secrete" + aodh_oslomsg_rpc_servers: "10.100.100.2" + aodh_oslomsg_rpc_use_ssl: true + aodh_oslomsg_rpc_port: 5671 + aodh_oslomsg_notify_transport: rabbit + aodh_oslomsg_notify_password: "secrete" + aodh_oslomsg_notify_servers: "10.100.100.2" + aodh_oslomsg_notify_use_ssl: true + aodh_oslomsg_notify_port: 5671 # Needed to setup the aodh service in Keystone keystone_admin_user_name: admin keystone_admin_tenant_name: admin diff --git a/defaults/main.yml b/defaults/main.yml index ae84cb0..d93571c 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -61,12 +61,22 @@ aodh_galera_use_ssl: "{{ galera_use_ssl | default(False) }}" aodh_galera_ssl_ca_cert: "{{ galera_ssl_ca_cert | default('/etc/ssl/certs/galera-ca.pem') }}" aodh_connection_string: "{{ aodh_db_type }}://{{ aodh_database_user }}:{{ aodh_container_db_password }}@{{ aodh_db_address }}/{{ aodh_database_name }}?charset=utf8{% if aodh_galera_use_ssl | bool %}&ssl_ca={{ aodh_galera_ssl_ca_cert }}{% endif %}" -## RabbitMQ info -aodh_rabbitmq_userid: aodh -aodh_rabbitmq_vhost: /aodh -aodh_rabbitmq_servers: 127.0.0.1 -aodh_rabbitmq_port: 5672 -aodh_rabbitmq_use_ssl: False +# Oslo Messaging +# RPC +aodh_oslomsg_rpc_transport: rabbit +aodh_oslomsg_rpc_servers: 127.0.0.1 +aodh_oslomsg_rpc_port: 5672 +aodh_oslomsg_rpc_use_ssl: False +aodh_oslomsg_rpc_userid: aodh +aodh_oslomsg_rpc_vhost: /aodh + +# Notify +aodh_oslomsg_notify_transport: rabbit +aodh_oslomsg_notify_servers: 127.0.0.1 +aodh_oslomsg_notify_port: 5672 +aodh_oslomsg_notify_use_ssl: False +aodh_oslomsg_notify_userid: aodh +aodh_oslomsg_notify_vhost: /aodh ## Apache setup aodh_apache_log_level: info @@ -152,7 +162,8 @@ aodh_services: aodh_required_secrets: - memcached_encryption_key - aodh_container_db_password - - aodh_rabbitmq_password + - aodh_oslomsg_rpc_password + - aodh_oslomsg_notify_password - aodh_service_password install_test_packages: False diff --git a/doc/source/index.rst b/doc/source/index.rst index c92c256..0573be9 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -39,11 +39,17 @@ To use this role, define the following variables: # Needed for aodh to talk to memcached memcached_servers: 127.0.0.1 memcached_encryption_key: "some_key" - # Needed for aodh to locate and connect to the RabbitMQ cluster - aodh_rabbitmq_password: "secrete" - rabbitmq_servers: "10.100.100.2" - rabbitmq_use_ssl: true - rabbitmq_port: 5671 + # Needed for aodh to locate and connect to Oslo.Messaging + aodh_oslomsg_rpc_transport: rabbit + aodh_oslomsg_rpc_password: "secrete" + aodh_oslomsg_rpc_servers: "10.100.100.2" + aodh_oslomsg_rpc_use_ssl: true + aodh_oslomsg_rpc_port: 5671 + aodh_oslomsg_notify_transport: rabbit + aodh_oslomsg_notify_password: "secrete" + aodh_oslomsg_notify_servers: "10.100.100.2" + aodh_oslomsg_notify_use_ssl: true + aodh_oslomsg_notify_port: 5671 # Needed to setup the aodh service in Keystone keystone_admin_user_name: admin keystone_admin_tenant_name: admin diff --git a/examples/playbook.yml b/examples/playbook.yml index 754c225..09f014e 100644 --- a/examples/playbook.yml +++ b/examples/playbook.yml @@ -11,11 +11,17 @@ # Needed for aodh to talk to memcached memcached_servers: 127.0.0.1 memcached_encryption_key: "some_key" - # Needed for aodh to locate and connect to the RabbitMQ cluster - aodh_rabbitmq_password: "secrete" - rabbitmq_servers: "10.100.100.2" - rabbitmq_use_ssl: true - rabbitmq_port: 5671 + # Needed for aodh to locate and connect to Oslo.Messaging + aodh_oslomsg_rpc_transport: rabbit + aodh_oslomsg_rpc_password: "secrete" + aodh_oslomsg_rpc_servers: "10.100.100.2" + aodh_oslomsg_rpc_use_ssl: true + aodh_oslomsg_rpc_port: 5671 + aodh_oslomsg_notify_transport: rabbit + aodh_oslomsg_notify_password: "secrete" + aodh_oslomsg_notify_servers: "10.100.100.2" + aodh_oslomsg_notify_use_ssl: true + aodh_oslomsg_notify_port: 5671 # Needed to setup the aodh service in Keystone keystone_admin_user_name: admin keystone_admin_tenant_name: admin diff --git a/releasenotes/notes/oslo-messaging-separate-backends-60f81dae397b1c96.yaml b/releasenotes/notes/oslo-messaging-separate-backends-60f81dae397b1c96.yaml new file mode 100644 index 0000000..4320841 --- /dev/null +++ b/releasenotes/notes/oslo-messaging-separate-backends-60f81dae397b1c96.yaml @@ -0,0 +1,15 @@ +--- +features: + - Support separate oslo.messaging services for RPC and Notifications + to enable operation of separate and different messaging backend servers. +deprecations: + - | + The rabbitmq server parameters have been replaced by corresponding + oslo.messaging RPC and Notify parameters in order to abstract the + messaging service from the actual backend server deployment. + - aodh_oslomsg_rpc_servers replaces aodh_rabbitmq_servers + - aodh_oslomsg_rpc_port replaces aodh_rabbitmq_port + - aodh_oslomsg_rpc_use_ssl replaces aodh_rabbitmq_use_ssl + - aodh_oslomsg_rpc_userid replaces aodh_rabbitmq_userid + - aodh_oslomsg_rpc_vhost replaces aodh_rabbitmq_vhost + - aodh_oslomsg_rpc_password replaces aodh_rabbitmq_password diff --git a/templates/aodh.conf.j2 b/templates/aodh.conf.j2 index 89cc956..3f2c353 100644 --- a/templates/aodh.conf.j2 +++ b/templates/aodh.conf.j2 @@ -5,10 +5,10 @@ use_stderr = False auth_strategy = keystone debug = {{ debug }} -transport_url = rabbit://{% for host in aodh_rabbitmq_servers.split(',') %}{{ aodh_rabbitmq_userid }}:{{ aodh_rabbitmq_password }}@{{ host }}:{{ aodh_rabbitmq_port }}{% if not loop.last %},{% else %}/{{ aodh_rabbitmq_vhost }}{% endif %}{% endfor %} +transport_url = {{ aodh_oslomsg_rpc_transport }}://{% for host in aodh_oslomsg_rpc_servers.split(',') %}{{ aodh_oslomsg_rpc_userid }}:{{ aodh_oslomsg_rpc_password }}@{{ host }}:{{ aodh_oslomsg_rpc_port }}{% if not loop.last %},{% else %}/{{ aodh_oslomsg_rpc_vhost }}{% if aodh_oslomsg_rpc_use_ssl | bool %}?ssl=1{% else %}?ssl=0{% endif %}{% endif %}{% endfor %} [oslo_messaging_rabbit] -ssl = {{ aodh_rabbitmq_use_ssl }} +ssl = {{ aodh_oslomsg_rpc_use_ssl }} [api] port = {{ aodh_service_port }} @@ -36,6 +36,9 @@ token_cache_time = 300 memcache_security_strategy = ENCRYPT memcache_secret_key = {{ memcached_encryption_key }} +[oslo_messaging_notifications] +transport_url = {{ aodh_oslomsg_notify_transport }}://{% for host in aodh_oslomsg_notify_servers.split(',') %}{{ aodh_oslomsg_notify_userid }}:{{ aodh_oslomsg_notify_password }}@{{ host }}:{{ aodh_oslomsg_notify_port }}{% if not loop.last %},{% else %}/{{ aodh_oslomsg_notify_vhost }}{% if aodh_oslomsg_notify_use_ssl | bool %}?ssl=1{% else %}?ssl=0{% endif %}{% endif %}{% endfor %} + [service_credentials] auth_type = {{ aodh_keystone_auth_plugin }} auth_url = {{ keystone_service_internalurl }} diff --git a/tests/inventory b/tests/inventory index 0d0bae2..03fe8e0 100644 --- a/tests/inventory +++ b/tests/inventory @@ -11,6 +11,12 @@ openstack1 aodh gnocchi +[oslomsg_rpc_all] +infra1 + +[oslomsg_notify_all] +infra1 + [rabbitmq_all] infra1 diff --git a/tests/os_aodh-overrides.yml b/tests/os_aodh-overrides.yml index e808ac4..1f87bf2 100644 --- a/tests/os_aodh-overrides.yml +++ b/tests/os_aodh-overrides.yml @@ -16,10 +16,12 @@ aodh_container_db_password: "secrete" aodh_db_address: "{{ test_galera_host }}" aodh_database_name: aodh -aodh_rabbitmq_servers: "{{ rabbitmq_servers }}" -aodh_rabbitmq_password: "secrete" -aodh_rabbitmq_userid: aodh -aodh_rabbitmq_vhost: /aodh +aodh_oslomsg_rpc_password: "secrete" +aodh_oslomsg_notify_password: "secrete" +aodh_oslomsg_rpc_userid: aodh +aodh_oslomsg_rpc_vhost: /aodh +aodh_oslomsg_notify_userid: aodh +aodh_oslomsg_notify_vhost: /aodh aodh_venv_tag: "testing" aodh_developer_mode: true aodh_service_password: "secrete" diff --git a/tests/test-install-aodh.yml b/tests/test-install-aodh.yml index 2628fe4..13709b9 100644 --- a/tests/test-install-aodh.yml +++ b/tests/test-install-aodh.yml @@ -18,10 +18,13 @@ user: root gather_facts: true pre_tasks: - - include: common/ensure-rabbitmq.yml - vhost_name: "{{ aodh_rabbitmq_vhost }}" - user_name: "{{ aodh_rabbitmq_userid }}" - user_password: "{{ aodh_rabbitmq_password }}" + - include: common/ensure-oslomsg.yml + rpc_vhost: "{{ aodh_oslomsg_rpc_vhost }}" + rpc_user: "{{ aodh_oslomsg_rpc_userid }}" + rpc_password: "{{ aodh_oslomsg_rpc_password }}" + notify_vhost: "{{ aodh_oslomsg_notify_vhost }}" + notify_user: "{{ aodh_oslomsg_notify_userid }}" + notify_password: "{{ aodh_oslomsg_notify_password }}" - include: common/create-grant-db.yml db_name: "{{ aodh_database_name }}" db_password: "{{ aodh_container_db_password }}"