From cb44aacbe00bf91010732615a9a001f16b75c57e Mon Sep 17 00:00:00 2001 From: Andy Smith Date: Mon, 23 Jul 2018 13:51:53 -0400 Subject: [PATCH] Setup oslo.messaging extra packages for optional drivers Change-Id: I5d29c1f459a62de868c8342e843025093b92f5fc --- defaults/main.yml | 7 +++++++ tasks/sahara_install.yml | 14 ++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/defaults/main.yml b/defaults/main.yml index 4512c3a..7dd31a1 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -79,6 +79,10 @@ sahara_oslomsg_notify_use_ssl: "{{ oslomsg_notify_use_ssl | default(False) }}" sahara_oslomsg_notify_userid: sahara sahara_oslomsg_notify_vhost: /sahara +## (Qdrouterd) info +# TODO(ansmith): Change structure when more backends will be supported +sahara_oslomsg_amqp1_enabled: "{{ sahara_oslomsg_rpc_transport == 'amqp' }}" + ## Database info sahara_db_setup_host: "{{ ('galera_all' in groups) | ternary(groups['galera_all'][0], 'localhost') }}" sahara_galera_address: "{{ galera_address | default('127.0.0.1') }}" @@ -174,6 +178,9 @@ sahara_pip_packages: - warlock - uwsgi +sahara_optional_oslomsg_amqp1_pip_packages: + - oslo.messaging[amqp1] + sahara_engine_init_overrides: {} sahara_api_init_overrides: {} diff --git a/tasks/sahara_install.yml b/tasks/sahara_install.yml index c9037cd..daad688 100644 --- a/tasks/sahara_install.yml +++ b/tasks/sahara_install.yml @@ -117,6 +117,20 @@ tags: - skip_ansible_lint +- name: Install optional pip packages + pip: + name: "{{ sahara_optional_oslomsg_amqp1_pip_packages }}" + state: "{{ sahara_pip_package_state }}" + virtualenv: "{{ sahara_bin | dirname }}" + virtualenv_site_packages: "no" + when: sahara_oslomsg_amqp1_enabled + register: install_optional_packages + until: install_optional_packages is success + retries: 5 + delay: 2 + notify: + - Restart sahara services + - name: Record the venv tag deployed ini_file: dest: "/etc/ansible/facts.d/openstack_ansible.fact"