From 35777b93ef6ad491106659df2aeb8a78b160b222 Mon Sep 17 00:00:00 2001 From: Andy Smith Date: Mon, 10 Dec 2018 14:23:33 -0500 Subject: [PATCH] Add qdrouterd role for rpc messaging backend deployment This patch introduces the qdrouterd role for deployment as a direct messaging bus for oslo.messaging rpc communications. The qdrouterd is deployed as infrastructure in a manner similar to the rabbitmq server. This patch: * Add to role requirements * Add to inventory * Add to playbooks * Add experimental aio job Change-Id: If9eed3d5848939eac005651336a1305433d96dbf --- ansible-role-requirements.yml | 4 ++ etc/openstack_deploy/conf.d/qdrouterd.yml.aio | 3 ++ inventory/env.d/qdrouterd.yml | 36 +++++++++++++ inventory/group_vars/all/infra.yml | 12 +++++ inventory/group_vars/all/oslo-messaging.yml | 12 ++--- inventory/inventory.ini | 2 + playbooks/qdrouterd-install.yml | 53 +++++++++++++++++++ playbooks/setup-infrastructure.yml | 1 + tests/test_inventory.py | 6 +++ zuul.d/jobs.yaml | 8 +++ zuul.d/project-templates.yaml | 1 + 11 files changed, 132 insertions(+), 6 deletions(-) create mode 100644 etc/openstack_deploy/conf.d/qdrouterd.yml.aio create mode 100644 inventory/env.d/qdrouterd.yml create mode 100644 playbooks/qdrouterd-install.yml diff --git a/ansible-role-requirements.yml b/ansible-role-requirements.yml index c1229c78b4..6a1772d130 100644 --- a/ansible-role-requirements.yml +++ b/ansible-role-requirements.yml @@ -150,6 +150,10 @@ scm: git src: https://git.openstack.org/openstack/openstack-ansible-plugins version: master +- name: qdrouterd + scm: git + src: https://git.openstack.org/openstack/ansible-role-qdrouterd + version: master - name: rabbitmq_server scm: git src: https://git.openstack.org/openstack/openstack-ansible-rabbitmq_server diff --git a/etc/openstack_deploy/conf.d/qdrouterd.yml.aio b/etc/openstack_deploy/conf.d/qdrouterd.yml.aio new file mode 100644 index 0000000000..2dffdfab52 --- /dev/null +++ b/etc/openstack_deploy/conf.d/qdrouterd.yml.aio @@ -0,0 +1,3 @@ +oslomsg-rpc_hosts: + aio1: + ip: 172.29.236.100 diff --git a/inventory/env.d/qdrouterd.yml b/inventory/env.d/qdrouterd.yml new file mode 100644 index 0000000000..38f38ef18c --- /dev/null +++ b/inventory/env.d/qdrouterd.yml @@ -0,0 +1,36 @@ +--- +# Copyright 2018, Red Hat, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +component_skel: + qdrouterd: + belongs_to: + - qdrouterd_all + + +container_skel: + qdrouterd_container: + belongs_to: + - oslomsg-rpc_containers + contains: + - qdrouterd + + +physical_skel: + oslomsg-rpc_containers: + belongs_to: + - all_containers + oslomsg-rpc_hosts: + belongs_to: + - hosts diff --git a/inventory/group_vars/all/infra.yml b/inventory/group_vars/all/infra.yml index 036623cba1..2b7b5a2783 100644 --- a/inventory/group_vars/all/infra.yml +++ b/inventory/group_vars/all/infra.yml @@ -39,3 +39,15 @@ memcached_servers: >- | list | join(',') }} + +## Qdrouterd options +qdrouterd_host_group: "qdrouterd_all" +qdrouterd_port: "{{ (qdrouterd_use_ssl | bool) | ternary(31459, 31460) }}" + +qdrouterd_use_ssl: False +qdrouterd_servers: >- + {{ + groups[qdrouterd_host_group] + | map('extract', hostvars, 'ansible_host') + | list | join(',') + }} diff --git a/inventory/group_vars/all/oslo-messaging.yml b/inventory/group_vars/all/oslo-messaging.yml index 59dd4e59c4..955418861c 100644 --- a/inventory/group_vars/all/oslo-messaging.yml +++ b/inventory/group_vars/all/oslo-messaging.yml @@ -14,14 +14,14 @@ ## Main # RPC -oslomsg_rpc_transport: rabbit -oslomsg_rpc_port: "{{ rabbitmq_port }}" -oslomsg_rpc_servers: "{{ rabbitmq_servers }}" -oslomsg_rpc_use_ssl: "{{ rabbitmq_use_ssl }}" -oslomsg_rpc_host_group: "{{ rabbitmq_host_group }}" +oslomsg_rpc_transport: "{{ (groups[qdrouterd_host_group] | length > 0) | ternary('amqp', 'rabbit') }}" +oslomsg_rpc_port: "{{ (groups[qdrouterd_host_group] | length > 0) | ternary(qdrouterd_port, rabbitmq_port) }}" +oslomsg_rpc_servers: "{{ (groups[qdrouterd_host_group] | length > 0) | ternary(qdrouterd_servers, rabbitmq_servers) }}" +oslomsg_rpc_use_ssl: "{{ (groups[qdrouterd_host_group] | length > 0) | ternary(qdrouterd_use_ssl, rabbitmq_use_ssl) }}" +oslomsg_rpc_host_group: "{{ (groups[qdrouterd_host_group] | length > 0) | ternary(qdrouterd_host_group, rabbitmq_host_group) }}" # Notify -oslomsg_notify_transport: rabbit +oslomsg_notify_transport: "{{ (groups[rabbitmq_host_group] | length > 0) | ternary('rabbit', 'none') }}" oslomsg_notify_port: "{{ rabbitmq_port }}" oslomsg_notify_servers: "{{ rabbitmq_servers }}" oslomsg_notify_use_ssl: "{{ rabbitmq_use_ssl }}" diff --git a/inventory/inventory.ini b/inventory/inventory.ini index 9a73ed1691..be59a8ac51 100644 --- a/inventory/inventory.ini +++ b/inventory/inventory.ini @@ -18,6 +18,8 @@ hosts [memcached] +[qdrouterd_all] + [rabbitmq_all] [repo_all] diff --git a/playbooks/qdrouterd-install.yml b/playbooks/qdrouterd-install.yml new file mode 100644 index 0000000000..f24a87b5e5 --- /dev/null +++ b/playbooks/qdrouterd-install.yml @@ -0,0 +1,53 @@ +--- +# Copyright 2018, Red Hat, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +- name: Create and configure qdrouterd container + hosts: "{{ qdrouterd_host_group | default('qdrouterd_all') }}" + serial: 1 + gather_facts: "{{ osa_gather_facts | default(True) }}" + user: root + environment: "{{ deployment_environment_variables | default({}) }}" + tags: + - qdrouterd + pre_tasks: + - include_tasks: "common-tasks/os-{{ container_tech | default('lxc') }}-container-setup.yml" + vars: + extra_container_config_no_restart: + - "lxc.start.order=19" + when: not is_metal + + - include_tasks: common-tasks/unbound-clients.yml + when: + - hostvars['localhost']['resolvconf_enabled'] | bool + roles: + - role: "system_crontab_coordination" + + +- name: Install qdrouterd server + hosts: "{{ qdrouterd_host_group | default('qdrouterd_all') }}" + serial: 20% + user: root + environment: "{{ deployment_environment_variables | default({}) }}" + tags: + - qdrouterd + roles: + - role: "qdrouterd" + + post_tasks: + - include_tasks: "common-tasks/rsyslog-client.yml" + vars: + rsyslog_client_log_rotate_file: qdrouterd_log_rotate + rsyslog_client_log_dir: "/var/log/qdrouterd" + rsyslog_client_config_name: "99-qdrouterd-rsyslog-client.conf" diff --git a/playbooks/setup-infrastructure.yml b/playbooks/setup-infrastructure.yml index 71bb623006..1f0cffdceb 100644 --- a/playbooks/setup-infrastructure.yml +++ b/playbooks/setup-infrastructure.yml @@ -23,6 +23,7 @@ - import_playbook: utility-install.yml - import_playbook: memcached-install.yml - import_playbook: galera-install.yml +- import_playbook: qdrouterd-install.yml - import_playbook: rabbitmq-install.yml - import_playbook: etcd-install.yml - import_playbook: ceph-install.yml diff --git a/tests/test_inventory.py b/tests/test_inventory.py index 7745ffc8d1..bd3d8285f7 100644 --- a/tests/test_inventory.py +++ b/tests/test_inventory.py @@ -361,7 +361,13 @@ class TestAnsibleInventoryFormatConstraints(unittest.TestCase): 'orchestration_hosts', 'os-infra_containers', 'os-infra_hosts', + 'oslomsg-rpc_all', + 'oslomsg-rpc_containers', + 'oslomsg-rpc_hosts', 'pkg_repo', + 'qdrouterd', + 'qdrouterd_all', + 'qdrouterd_container', 'rabbit_mq_container', 'rabbitmq', 'rabbitmq_all', diff --git a/zuul.d/jobs.yaml b/zuul.d/jobs.yaml index 641a992f9d..d1f6120d6d 100644 --- a/zuul.d/jobs.yaml +++ b/zuul.d/jobs.yaml @@ -152,6 +152,14 @@ action: deploy scenario: aio_octavia +- job: + name: openstack-ansible-deploy-aio_qdrouterd-ubuntu-bionic + parent: openstack-ansible-deploy-aio + nodeset: ubuntu-bionic + vars: + action: deploy + scenario: aio_qdrouterd + - job: name: openstack-ansible-deploy-translations-ubuntu-bionic parent: openstack-ansible-deploy-aio diff --git a/zuul.d/project-templates.yaml b/zuul.d/project-templates.yaml index 8903689f45..3da948a085 100644 --- a/zuul.d/project-templates.yaml +++ b/zuul.d/project-templates.yaml @@ -33,6 +33,7 @@ - openstack-ansible-deploy-barbican-ubuntu-bionic - openstack-ansible-deploy-aio_congress-ubuntu-bionic - openstack-ansible-deploy-aio_octavia-ubuntu-bionic + - openstack-ansible-deploy-aio_qdrouterd-ubuntu-bionic - openstack-ansible-deploy_with_ansible_devel-aio-ubuntu-bionic - openstack-ansible-deploy_with_ansible_next-aio-ubuntu-bionic - openstack-ansible-deploy-blazar-ubuntu-bionic