From ebe570bb840d79f78816d13c72729a5c80f159f0 Mon Sep 17 00:00:00 2001
From: Michal Nasiadka <mnasiadka@gmail.com>
Date: Tue, 7 Jun 2022 06:54:11 +0200
Subject: [PATCH] CI: Switch upgrades xena->yoga to yoga->master

R-17: Switch source images to current release

Disable rocky8 and openeuler jobs as master no longer works with
python3.6.

Change-Id: I89dd99b5f25502f5ebe15a9e90ccecc4bd6feafa
---
 ansible/group_vars/all.yml         |  2 +-
 tests/run.yml                      | 10 +++-------
 tests/templates/globals-default.j2 |  3 +--
 zuul.d/base.yaml                   |  8 +++-----
 zuul.d/project.yaml                |  6 +++---
 5 files changed, 11 insertions(+), 18 deletions(-)

diff --git a/ansible/group_vars/all.yml b/ansible/group_vars/all.yml
index c9d4c7b8b2..8c992fd09d 100644
--- a/ansible/group_vars/all.yml
+++ b/ansible/group_vars/all.yml
@@ -540,7 +540,7 @@ openstack_logging_debug: "False"
 openstack_region_name: "RegionOne"
 
 # Variable defined the pin_release_version, apply for rolling upgrade process
-openstack_previous_release_name: "xena"
+openstack_previous_release_name: "yoga"
 
 # A list of policy file formats that are supported by Oslo.policy
 supported_policy_format_list:
diff --git a/tests/run.yml b/tests/run.yml
index 7fd36e6b13..31bf01f016 100644
--- a/tests/run.yml
+++ b/tests/run.yml
@@ -93,9 +93,6 @@
               echo "ansible-collection-kolla checked out to:"
               git log --pretty=oneline  -1
             chdir: "{{ ansible_collection_kolla_src_dir }}"
-          # TODO(mgoddard): Do this unconditionally when previous_release is
-          # yoga.
-          when: previous_release != 'xena'
 
         - name: checkout the previous kolla-ansible branch
           shell:
@@ -205,7 +202,6 @@
               dest: ironic-agent.kernel
       when: scenario == "ironic"
 
-    # TODO(mgoddard): Do this unconditionally when previous_release is yoga.
     - block:
         - name: slurp requirements.yml
           slurp:
@@ -223,7 +219,6 @@
               type: dir
             new_requirements:
               collections: "{{ (old_requirements.collections | rejectattr('name', 'search', 'ansible-collection-kolla') | list) + [new_requirement] }}"
-      when: not is_upgrade or previous_release != 'xena'
 
     - name: ensure /etc/ansible exists
       file:
@@ -252,11 +247,9 @@
         ansible{{ ansible_version_constraint }}
         ara<1.0.0
 
-    # TODO(mgoddard): do this unconditionally when previous release is Yoga.
     - name: install Ansible collections
       command: >-
         kolla-ansible install-deps
-      when: not is_upgrade or previous_release != 'xena'
 
     - name: get ARA callback plugin path
       command: "python3 -m ara.setup.callback_plugins"
@@ -577,9 +570,12 @@
               git log --pretty=oneline  -1
             chdir: "{{ ansible_collection_kolla_src_dir }}"
 
+        # NOTE(frickler): We modified requirements.yml, need to revert the
+        # changes in order for the branch checkout to succeed
         - name: checkout the current kolla-ansible branch
           shell:
             cmd: |
+              git checkout requirements.yml
               git checkout {{ zuul.branch }}
               echo "kolla-ansible checked out to:"
               git log --pretty=oneline  -1
diff --git a/tests/templates/globals-default.j2 b/tests/templates/globals-default.j2
index a5f885465d..3e08e2df29 100644
--- a/tests/templates/globals-default.j2
+++ b/tests/templates/globals-default.j2
@@ -148,8 +148,7 @@ openstack_cacert: "/etc/pki/tls/certs/ca-bundle.crt"
 {% endif %}
 kolla_admin_openrc_cacert: "{% raw %}{{ kolla_certificates_dir }}{% endraw %}/ca/root.crt"
 rabbitmq_enable_tls: "yes"
-# TODO(mgoddard): Set this to "yes" when previous release is Yoga.
-libvirt_tls: "{{ not is_upgrade or previous_release != 'xena' }}"
+libvirt_tls: "yes"
 {% endif %}
 
 {% if scenario == 'linuxbridge' %}
diff --git a/zuul.d/base.yaml b/zuul.d/base.yaml
index 9a36303791..3f551cdea2 100644
--- a/zuul.d/base.yaml
+++ b/zuul.d/base.yaml
@@ -10,8 +10,7 @@
       - openstack/ansible-collection-kolla
       - openstack/kolla
       - openstack/kolla-ansible
-      - name: openstack/requirements
-        override-checkout: stable/yoga
+      - openstack/requirements
     irrelevant-files:
       - ^.*\.rst$
       - ^doc/.*
@@ -27,7 +26,7 @@
       - ^kolla_ansible/tests/
       - ^zuul\.d/
     vars:
-      previous_release: xena
+      previous_release: yoga
       scenario: core
       virt_type: qemu
       is_upgrade: no
@@ -248,8 +247,7 @@
     run: tests/run-hashi-vault.yml
     required-projects:
       - openstack/kolla-ansible
-      - name: openstack/requirements
-        override-checkout: stable/yoga
+      - openstack/requirements
     voting: false
     irrelevant-files:
       - ^.*\.rst$
diff --git a/zuul.d/project.yaml b/zuul.d/project.yaml
index b8eba7c7c0..88d72ac682 100644
--- a/zuul.d/project.yaml
+++ b/zuul.d/project.yaml
@@ -11,10 +11,10 @@
       - periodic-stable-jobs
     check:
       jobs:
-        # # - kolla-ansible-centos8s-source
+        # - kolla-ansible-centos8s-source
         - kolla-ansible-debian-source
-        - kolla-ansible-openeuler-source
-        - kolla-ansible-rocky8-source
+        # - kolla-ansible-openeuler-source
+        # - kolla-ansible-rocky8-source
         - kolla-ansible-ubuntu-source
         # - kolla-ansible-centos8s-source-kvm
         - kolla-ansible-ubuntu-source-kvm