From e6f839e41a8f29675fbb3df9c7bd0d276834c774 Mon Sep 17 00:00:00 2001 From: Kirill Bespalov Date: Thu, 29 Dec 2016 11:59:55 +0300 Subject: [PATCH] Messaging multi-backend support Allow to set backend-related dependencies and configurations for oslo.messaging. Change-Id: I422f6f4df3198b49e0e903ced1cf45936fc24162 --- service/calico-dhcp-agent.yaml | 3 ++- service/files/neutron.conf.j2 | 16 +++++----------- service/neutron-dhcp-agent.yaml | 3 ++- service/neutron-l3-agent.yaml | 3 ++- service/neutron-metadata-agent.yaml | 2 +- service/neutron-openvswitch-agent.yaml | 3 ++- service/neutron-server.yaml | 3 ++- 7 files changed, 16 insertions(+), 17 deletions(-) diff --git a/service/calico-dhcp-agent.yaml b/service/calico-dhcp-agent.yaml index 476e33b..2bb6a26 100644 --- a/service/calico-dhcp-agent.yaml +++ b/service/calico-dhcp-agent.yaml @@ -15,7 +15,8 @@ service: command: calico-dhcp-agent --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/ml2_conf.ini dependencies: - neutron-db-sync - - rabbitmq + - "{{ messaging.dependencies[messaging.backend.rpc] }}" + - "{{ messaging.dependencies[messaging.backend.notifications] }}" files: - neutron.conf - ml2-conf.ini diff --git a/service/files/neutron.conf.j2 b/service/files/neutron.conf.j2 index 2136ece..302aeb8 100644 --- a/service/files/neutron.conf.j2 +++ b/service/files/neutron.conf.j2 @@ -42,14 +42,6 @@ endpoint_type = internal [oslo_concurrency] lock_path = /var/lib/neutron/tmp -[oslo_messaging_rabbit] -rabbit_userid = {{ rabbitmq.user }} -rabbit_password = {{ rabbitmq.password }} -rabbit_ha_queues = true -# Here we should have a list of RBMQ servers, but for now 1 is ok -# FIXME -rabbit_hosts = {{ address('rabbitmq', rabbitmq.port) }} - [agent] root_helper = sudo neutron-rootwrap /etc/neutron/rootwrap.conf root_helper_daemon = sudo neutron-rootwrap-daemon /etc/neutron/rootwrap.conf @@ -69,9 +61,11 @@ username = {{ neutron.db.username }} password = {{ neutron.db.password }} memcached_servers = {{ address('memcached', memcached.port) }} -[oslo_messaging_notifications] {% if searchlight is defined and (searchlight.services.neutron or searchlight.services.nova) %} +[oslo_messaging_notifications] driver = {{ searchlight.notification_driver }} -{% else %} -driver = noop {% endif %} + +{# messaging macros templates #} +{{ oslo_messaging[messaging.backend.notifications]('notifications_config') }} +{{ oslo_messaging[messaging.backend.rpc]('rpc_config') }} diff --git a/service/neutron-dhcp-agent.yaml b/service/neutron-dhcp-agent.yaml index 3522440..0df854c 100644 --- a/service/neutron-dhcp-agent.yaml +++ b/service/neutron-dhcp-agent.yaml @@ -18,7 +18,8 @@ service: command: neutron-dhcp-agent --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/dhcp_agent.ini dependencies: - neutron-db-sync - - rabbitmq + - "{{ messaging.dependencies[messaging.backend.rpc] }}" + - "{{ messaging.dependencies[messaging.backend.notifications] }}" files: - neutron.conf - ml2-conf.ini diff --git a/service/neutron-l3-agent.yaml b/service/neutron-l3-agent.yaml index 72a6245..65cdfbc 100644 --- a/service/neutron-l3-agent.yaml +++ b/service/neutron-l3-agent.yaml @@ -18,7 +18,8 @@ service: command: neutron-l3-agent --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/l3_agent.ini --config-file /etc/neutron/plugins/ml2/ml2_conf.ini dependencies: - neutron-db-sync - - rabbitmq + - "{{ messaging.dependencies[messaging.backend.rpc] }}" + - "{{ messaging.dependencies[messaging.backend.notifications] }}" files: - neutron.conf - ml2-conf.ini diff --git a/service/neutron-metadata-agent.yaml b/service/neutron-metadata-agent.yaml index a54e67f..0a56d73 100644 --- a/service/neutron-metadata-agent.yaml +++ b/service/neutron-metadata-agent.yaml @@ -17,7 +17,7 @@ service: command: neutron-metadata-agent --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/metadata-agent.ini dependencies: - neutron-db-sync - - rabbitmq + - "{{ messaging.dependencies[messaging.backend.rpc] }}" files: - neutron.conf - ml2-conf.ini diff --git a/service/neutron-openvswitch-agent.yaml b/service/neutron-openvswitch-agent.yaml index 3743c45..641cbe0 100644 --- a/service/neutron-openvswitch-agent.yaml +++ b/service/neutron-openvswitch-agent.yaml @@ -18,7 +18,8 @@ service: command: neutron-openvswitch-agent --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/ml2_conf.ini dependencies: - neutron-db-sync - - rabbitmq + - "{{ messaging.dependencies[messaging.backend.rpc] }}" + - "{{ messaging.dependencies[messaging.backend.notifications] }}" - openvswitch-vswitchd:local files: - neutron.conf diff --git a/service/neutron-server.yaml b/service/neutron-server.yaml index 1f69532..8b6bc2c 100644 --- a/service/neutron-server.yaml +++ b/service/neutron-server.yaml @@ -17,7 +17,8 @@ service: type: single command: neutron-db-manage --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/ml2_conf.ini upgrade head dependencies: - - rabbitmq + - "{{ messaging.dependencies[messaging.backend.rpc] }}" + - "{{ messaging.dependencies[messaging.backend.notifications] }}" - neutron-db-create files: - neutron.conf