From efb98a3ebc7c38f4c1741b511f2202572794ddc8 Mon Sep 17 00:00:00 2001 From: Andy Smith Date: Fri, 20 Jul 2018 15:22:24 -0400 Subject: [PATCH] Setup oslo.messaging extra packages for optional drivers Change-Id: Ib822a1799119b7c153929f6e80f20e0b110d266d --- defaults/main.yml | 9 +++++++-- tasks/glance_install_source.yml | 15 +++++++++++++++ 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index c019038a..80ff349f 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -91,8 +91,6 @@ glance_enable_v2_api: True # The registry service is scheduled for removal in the S cycle. glance_enable_v2_registry: False -## RabbitMQ info - ## Oslo Messaging Info # RPC @@ -116,6 +114,10 @@ glance_oslomsg_notify_userid: "{{ glance_oslomsg_rpc_userid }}" glance_oslomsg_notify_password: "{{ glance_oslomsg_rpc_password }}" glance_oslomsg_notify_vhost: "{{ glance_oslomsg_rpc_vhost }}" +## (Qdrouterd) integration +# TODO(ansmith): Change structure when more backends will be supported +glance_oslomsg_amqp1_enabled: "{{ glance_oslomsg_rpc_transport == 'amqp' }}" + ## Database info glance_db_setup_host: "{{ ('galera_all' in groups) | ternary(groups['galera_all'][0], 'localhost') }}" glance_galera_address: "{{ galera_address | default('127.0.0.1') }}" @@ -247,6 +249,9 @@ glance_pip_packages: - uwsgi - warlock +glance_optional_oslomsg_amqp1_pip_packages: + - oslo.messaging[amqp1] + glance_api_init_overrides: {} glance_registry_init_overrides: {} diff --git a/tasks/glance_install_source.yml b/tasks/glance_install_source.yml index b2e9fe3e..ff4a6add 100644 --- a/tasks/glance_install_source.yml +++ b/tasks/glance_install_source.yml @@ -107,6 +107,21 @@ tags: - skip_ansible_lint +- name: Install optional pip packages + pip: + name: "{{ glance_optional_oslomsg_amqp1_pip_packages }}" + state: "{{ glance_pip_package_state }}" + virtualenv: "{{ glance_bin | dirname }}" + virtualenv_site_packages: "no" + when: glance_oslomsg_amqp1_enabled + register: install_optional_packages + until: install_optional_packages is success + retries: 5 + delay: 2 + notify: + - Manage LB + - Restart glance services + - name: Record the need for a service restart ini_file: dest: "/etc/ansible/facts.d/openstack_ansible.fact"