From a59e71658bd2681e6e5924a8898c4bca7d324b3c Mon Sep 17 00:00:00 2001 From: Andy Smith Date: Fri, 20 Jul 2018 16:51:16 -0400 Subject: [PATCH] Setup oslo.messaging extra packages for optional drivers Change-Id: I006e28c3828f5ed28b5c6e020a2ee22885a74d95 --- defaults/main.yml | 7 +++++++ tasks/heat_install_source.yml | 4 +++- vars/distro_install.yml | 7 ++++++- vars/redhat-7.yml | 5 +++++ vars/source_install.yml | 7 ++++++- vars/suse-42.yml | 5 +++++ vars/ubuntu.yml | 4 ++++ 7 files changed, 36 insertions(+), 3 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 5711de6..4704bef 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -96,6 +96,10 @@ heat_oslomsg_notify_userid: "{{ heat_oslomsg_rpc_userid }}" heat_oslomsg_notify_password: "{{ heat_oslomsg_rpc_password }}" heat_oslomsg_notify_vhost: "{{ heat_oslomsg_rpc_vhost }}" +## (Qdrouterd) integration +# TODO(ansmith): Change structure when more backends will be supported +heat_oslomsg_amqp1_enabled: "{{ heat_oslomsg_rpc_transport == 'amqp' }}" + ## Heat User / Group heat_system_user_name: heat heat_system_group_name: heat @@ -221,6 +225,9 @@ heat_pip_packages: - python-troveclient - uwsgi +heat_optional_oslomsg_amqp1_pip_packages: + - oslo.messaging[amqp1] + heat_api_init_overrides: {} heat_api_cfn_init_overrides: {} heat_engine_init_overrides: {} diff --git a/tasks/heat_install_source.yml b/tasks/heat_install_source.yml index 362a88d..1e837de 100644 --- a/tasks/heat_install_source.yml +++ b/tasks/heat_install_source.yml @@ -42,7 +42,9 @@ venv_install_destination_path: "{{ heat_bin | dirname }}" venv_install_distro_package_list: "{{ heat_distro_packages }}" venv_pip_install_args: "{{ heat_pip_install_args }}" - venv_pip_packages: "{{ heat_pip_packages }}" + venv_pip_packages: >- + {{ heat_pip_packages + + (heat_oslomsg_amqp1_enabled | bool) | ternary(heat_optional_oslomsg_amqp1_pip_packages, []) }} venv_facts_when_changed: - section: "heat" option: "venv_tag" diff --git a/vars/distro_install.yml b/vars/distro_install.yml index f5a4872..142bb3e 100644 --- a/vars/distro_install.yml +++ b/vars/distro_install.yml @@ -13,6 +13,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -heat_package_list: "{{ heat_service_distro_packages }}" +heat_package_list: |- + {% set packages = heat_service_distro_packages %} + {% if heat_oslomsg_amqp1_enabled | bool %} + {% set _ = packages.extend(heat_oslomsg_amqp1_distro_packages) %} + {% endif %} + {{ packages }} heat_bin: "/usr/bin" diff --git a/vars/redhat-7.yml b/vars/redhat-7.yml index 82f798c..772a962 100644 --- a/vars/redhat-7.yml +++ b/vars/redhat-7.yml @@ -28,4 +28,9 @@ heat_service_distro_packages: - uwsgi - uwsgi-plugin-python +heat_oslomsg_amqp1_distro_packages: + - cyrus-sasl-lib + - cyrus-sasl-plain + - cyrus-sasl-md5 + heat_uwsgi_bin: '/usr/sbin' diff --git a/vars/source_install.yml b/vars/source_install.yml index 76f3f8d..b9df136 100644 --- a/vars/source_install.yml +++ b/vars/source_install.yml @@ -13,7 +13,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -heat_package_list: "{{ heat_distro_packages }}" +heat_package_list: |- + {% set packages = heat_service_distro_packages %} + {% if heat_oslomsg_amqp1_enabled | bool %} + {% set _ = packages.extend(heat_oslomsg_amqp1_distro_packages) %} + {% endif %} + {{ packages }} _heat_bin: "/openstack/venvs/heat-{{ heat_venv_tag }}/bin" heat_uwsgi_bin: "{{ _heat_bin }}" diff --git a/vars/suse-42.yml b/vars/suse-42.yml index 9108354..73e4778 100644 --- a/vars/suse-42.yml +++ b/vars/suse-42.yml @@ -28,4 +28,9 @@ heat_service_distro_packages: - uwsgi - uwsgi-python +heat_oslomsg_amqp1_distro_packages: + - cyrus-sasl + - cyrus-sasl-plain + - cyrus-sasl-digestmd5 + heat_uwsgi_bin: '/usr/sbin' diff --git a/vars/ubuntu.yml b/vars/ubuntu.yml index 820ad73..d9dc019 100644 --- a/vars/ubuntu.yml +++ b/vars/ubuntu.yml @@ -28,4 +28,8 @@ heat_service_distro_packages: - uwsgi - uwsgi-plugin-python +heat_oslomsg_amqp1_distro_packages: + - libsasl2-modules + - sasl2-bin + heat_uwsgi_bin: '/usr/bin'