From ec2a8eb1b1daf7cc806332dff499a8c79c39710b Mon Sep 17 00:00:00 2001
From: OpenStack Proposal Bot <openstack-infra@lists.openstack.org>
Date: Mon, 19 Apr 2021 10:00:28 +0000
Subject: [PATCH] Updated from OpenStack Ansible Tests

Change-Id: I4ac5aa9db822a27fb01918e11152e25e3c7bcc04
---
 Vagrantfile        | 25 +++++++------------------
 bindep.txt         |  7 ++-----
 run_tests.sh       |  8 +-------
 tasks/mq_setup.yml |  9 ++++++---
 4 files changed, 16 insertions(+), 33 deletions(-)

diff --git a/Vagrantfile b/Vagrantfile
index 7691c3c..4468b89 100644
--- a/Vagrantfile
+++ b/Vagrantfile
@@ -35,28 +35,17 @@ Vagrant.configure(2) do |config|
     centos8.vm.box = "centos/8"
   end
 
-  config.vm.define "debian8" do |debian8|
-    debian8.vm.box = "debian/jessie64"
-  end
-
-  config.vm.define "debian9" do |debian9|
-    debian9.vm.box = "debian/stretch64"
-  end
-
-  config.vm.define "gentoo" do |gentoo|
-    gentoo.vm.box = "generic/gentoo"
-  end
-
-  config.vm.define "opensuse150" do |leap150|
-    leap150.vm.box = "opensuse/openSUSE-15.0-x86_64"
-  end
-
-  config.vm.define "opensuse151" do |leap151|
-    leap151.vm.box = "opensuse/openSUSE-15.1-x86_64"
+  config.vm.define "debian10" do |debian10|
+    debian10.vm.box = "debian/buster64"
   end
 
   config.vm.define "ubuntu1804" do |bionic|
     bionic.disksize.size = "40GB"
     bionic.vm.box = "ubuntu/bionic64"
   end
+
+  config.vm.define "ubuntu2004" do |focal|
+    focal.disksize.size = "40GB"
+    focal.vm.box = "ubuntu/focal64"
+  end
 end
diff --git a/bindep.txt b/bindep.txt
index bb77692..3db7d13 100644
--- a/bindep.txt
+++ b/bindep.txt
@@ -26,7 +26,7 @@
 gcc
 
 # Base requirements for Ubuntu
-git-core          [platform:dpkg platform:suse]
+git-core          [platform:dpkg]
 libssl-dev        [platform:dpkg]
 libffi-dev        [platform:dpkg]
 python3           [platform:dpkg]
@@ -35,15 +35,12 @@ python3-dev       [platform:dpkg]
 
 # Base requirements for RPM distros
 gcc-c++           [platform:rpm]
-git               [platform:rpm !platform:suse]
+git               [platform:rpm]
 libffi-devel      [platform:rpm]
 openssl-devel     [platform:rpm]
 python3-dnf       [platform:fedora]
 python3-devel     [platform:rpm]
 
-# Base requirements for Gentoo
-git               [platform:gentoo]
-
 # For SELinux
 libselinux-python3  [platform:redhat]
 libsemanage-python3 [platform:redhat]
diff --git a/run_tests.sh b/run_tests.sh
index 93e91dd..221a098 100755
--- a/run_tests.sh
+++ b/run_tests.sh
@@ -53,19 +53,13 @@ source /etc/os-release || source /usr/lib/os-release
 
 # Figure out the appropriate package install command
 case ${ID,,} in
-    *suse*) pkg_mgr_cmd="zypper -n in" ;;
     centos|rhel|fedora) pkg_mgr_cmd="dnf install -y" ;;
     ubuntu|debian) pkg_mgr_cmd="apt-get install -y" ;;
-    # Gentoo needs to have version set since it's rolling
-    gentoo) pkg_mgr_cmd="emerge --jobs=4"; VERSION="rolling" ;;
     *) echo "unsupported distribution: ${ID,,}"; exit 1 ;;
 esac
 
 # Install git so that we can clone the tests repo if git is not available
-case ${ID,,} in
-  gentoo) which git &>/dev/null || eval sudo "${pkg_mgr_cmd}" dev-vcs/git ;;
-  *) which git &>/dev/null || eval sudo "${pkg_mgr_cmd}" git ;;
-esac
+which git &>/dev/null || eval sudo "${pkg_mgr_cmd}" git
 
 # Clone the tests repo for access to the common test script
 if [[ ! -d "${COMMON_TESTS_PATH}" ]]; then
diff --git a/tasks/mq_setup.yml b/tasks/mq_setup.yml
index 3e2a363..f435f7d 100644
--- a/tasks/mq_setup.yml
+++ b/tasks/mq_setup.yml
@@ -68,7 +68,8 @@
         state: "present"
       when:
         - (_oslomsg_rpc_vhost is undefined) or
-          (_oslomsg_notify_vhost != _oslomsg_rpc_vhost)
+          (_oslomsg_notify_vhost != _oslomsg_rpc_vhost) or
+          (_oslomsg_notify_setup_host != _oslomsg_rpc_setup_host)
 
     - name: Apply Notify RabbitMQ vhost policies
       community.rabbitmq.rabbitmq_policy:
@@ -80,7 +81,8 @@
       loop: "{{ _oslomsg_notify_policies | default([]) + oslomsg_notify_policies }}"
       when:
         - (_oslomsg_rpc_vhost is undefined) or
-          (_oslomsg_notify_vhost != _oslomsg_rpc_vhost)
+          (_oslomsg_notify_vhost != _oslomsg_rpc_vhost) or
+          (_oslomsg_notify_setup_host != _oslomsg_rpc_setup_host)
 
     - name: Add Notify RabbitMQ user
       community.rabbitmq.rabbitmq_user:
@@ -95,7 +97,8 @@
       no_log: true
       when:
         - (_oslomsg_rpc_userid is undefined) or
-          (_oslomsg_notify_userid != _oslomsg_rpc_userid)
+          (_oslomsg_notify_userid != _oslomsg_rpc_userid) or
+          (_oslomsg_notify_setup_host != _oslomsg_rpc_setup_host)
 
 - name: Setup RPC MQ Service (Qdrouterd)
   delegate_to: "{{ _oslomsg_rpc_setup_host }}"