Update to use oslo.messaging service 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.

This patch:
* Add oslo.messaging variables for RPC and Notify to defaults
* Add transport_url generation to conf
* Add oslo.messaging to tests inventory and update tests
* Install extra packages for optional drivers

Change-Id: I96d43d5ff04254352980a2c0ba40ed7bb2e9f234
This commit is contained in:
Andy Smith 2018-07-25 12:54:05 -04:00 committed by Jesse Pretorius (odyssey4me)
parent 11648896e7
commit 28b50f04e3
6 changed files with 72 additions and 17 deletions

View File

@ -100,12 +100,31 @@ congress_bind_address: 0.0.0.0
congress_service_port: 1789
congress_program_name: congress-server
## RabbitMQ info
congress_rabbitmq_userid: congress
congress_rabbitmq_vhost: /congress
congress_rabbitmq_port: 5672
congress_rabbitmq_servers: 127.0.0.1
congress_rabbitmq_use_ssl: False
## Oslo Messaging info
# RPC
congress_oslomsg_rpc_transport: rabbit
congress_oslomsg_rpc_servers: 127.0.0.1
congress_oslomsg_rpc_port: 5672
congress_oslomsg_rpc_use_ssl: False
congress_oslomsg_rpc_userid: congress
congress_oslomsg_rpc_vhost: /congress
# Notify
congress_oslomsg_notify_transport: rabbit
congress_oslomsg_notify_servers: 127.0.0.1
congress_oslomsg_notify_port: 5672
congress_oslomsg_notify_use_ssl: False
congress_oslomsg_notify_userid: "{{ congress_oslomsg_rpc_userid }}"
congress_oslomsg_notify_password: "{{ congress_oslomsg_rpc_password }}"
congress_oslomsg_notify_vhost: "{{ congress_oslomsg_rpc_vhost }}"
## (Qdrouterd) integration
# TODO(ansmith): Change structure when more backends will be supported
congress_oslomsg_amqp1_enabled: "{{ congress_oslomsg_rpc_transport == 'amqp' }}"
congress_optional_oslomsg_amqp1_pip_packages:
- oslo.messaging[amqp1]
# This variable is used by the repo_build process to determine
# which host group to check for members of before building the

View File

@ -89,6 +89,20 @@
notify:
- Restart congress services
- name: Install optional pip packages
pip:
name: "{{ congress_optional_oslomsg_amqp1_pip_packages }}"
state: "{{ congress_pip_package_state }}"
virtualenv: "{{ congress_bin | dirname }}"
virtualenv_site_packages: "no"
when: congress_oslomsg_amqp1_enabled
register: install_optional_packages
until: install_optional_packages is success
retries: 5
delay: 2
notify:
- Restart congress services
- name: Remove python from path first (CentOS, openSUSE)
file:
path: "{{ congress_bin | dirname }}/bin/python2.7"

View File

@ -64,6 +64,15 @@ auth_strategy = noauth
# errors seen in log, removed congress.datasources.swift_driver.SwiftDriver
drivers = congress.datasources.neutronv2_driver.NeutronV2Driver,congress.datasources.glancev2_driver.GlanceV2Driver,congress.datasources.nova_driver.NovaDriver,congress.datasources.keystone_driver.KeystoneDriver,congress.datasources.cinder_driver.CinderDriver,congress.datasources.swift_driver.SwiftDriver
# oslo.messaging default transport
transport_url = {{ congress_oslomsg_rpc_transport }}://{% for host in congress_oslomsg_rpc_servers.split(',') %}{{ congress_oslomsg_rpc_userid }}:{{ congress_oslomsg_rpc_password }}@{{ host }}:{{ congress_oslomsg_rpc_port }}{% if not loop.last %},{% else %}/{{ congress_oslomsg_rpc_vhost }}{% if (congress_oslomsg_rpc_use_ssl | lower) | bool %}?ssl=1{% else %}?ssl=0{% endif %}{% endif %}{% endfor %}
[oslo_messaging_rabbit]
ssl = {{ congress_oslomsg_notify_use_ssl | bool }}
[oslo_messaging_notifications]
transport_url = {{ congress_oslomsg_notify_transport }}://{% for host in congress_oslomsg_notify_servers.split(',') %}{{ congress_oslomsg_notify_userid }}:{{ congress_oslomsg_notify_password }}@{{ host }}:{{ congress_oslomsg_notify_port }}{% if not loop.last %},{% else %}/{{ congress_oslomsg_notify_vhost }}{% if (congress_oslomsg_notify_use_ssl | lower) | bool %}?ssl=1{% else %}?ssl=0{% endif %}{% endif %}{% endfor %}
[keystone_authtoken]
auth_host = "{{ keystone_admin_user_name }}"
auth_port = 5000

View File

@ -9,6 +9,12 @@ infra1
openstack1
congress1
[oslomsg_rpc_all]
infra1
[oslomsg_notify_all]
infra1
[rabbitmq_all]
infra1

View File

@ -14,14 +14,19 @@
# limitations under the License.
# Use the tests repo values
congress_rabbitmq_port: "{{ rabbitmq_port }}"
congress_rabbitmq_servers: "{{ rabbitmq_servers }}"
congress_rabbitmq_host_group: "{{ rabbitmq_host_group }}"
congress_rabbitmq_use_ssl: "{{ rabbitmq_use_ssl }}"
congress_oslomsg_rpc_port: "{{ oslomsg_rpc_port }}"
congress_oslomsg_rpc_use_ssl: "{{ oslomsg_rpc_use_ssl }}"
congress_oslomsg_rpc_servers: "{{ oslomsg_rpc_servers }}"
congress_oslomsg_rpc_host_group: "{{ oslomsg_rpc_host_group }}"
congress_oslomsg_notify_port: "{{ oslomsg_notify_port }}"
congress_oslomsg_notify_use_ssl: "{{ oslomsg_notify_use_ssl }}"
congress_oslomsg_notify_servers: "{{ oslomsg_notify_servers }}"
congress_oslomsg_notify_host_group: "{{ oslomsg_notify_host_group }}"
congress_galera_address: "{{ test_galera_host }}"
# Required settings with no defaults
congress_rabbitmq_password: "secrete"
congress_oslomsg_rpc_password: "secrete"
congress_oslomsg_notify_password: "{{ congress_oslomsg_rpc_password }}"
congress_service_password: "secrete"
congress_container_mysql_password: "secrete"

View File

@ -19,12 +19,14 @@
gather_facts: true
any_errors_fatal: true
pre_tasks:
- include: common/ensure-rabbitmq.yml
vhost_name: "{{ congress_rabbitmq_vhost }}"
user_name: "{{ congress_rabbitmq_userid }}"
user_password: "{{ congress_rabbitmq_password }}"
when:
- "groups['rabbitmq_all'] is defined"
- include: common/ensure-oslomsg.yml
rpc_vhost: "{{ congress_oslomsg_rpc_vhost }}"
rpc_user: "{{ congress_oslomsg_rpc_userid }}"
rpc_password: "{{ congress_oslomsg_rpc_password }}"
notify_vhost: "{{ congress_oslomsg_notify_vhost }}"
notify_user: "{{ congress_oslomsg_notify_userid }}"
notify_password: "{{ congress_oslomsg_notify_password }}"
roles:
- role: "os_congress"
vars_files: